Fix issues with trim() and with unit tests relying on certain line endings.
This commit is contained in:
@@ -807,8 +807,8 @@ namespace chaiscript
|
|||||||
const std::vector<Type_Info> lhsparamtypes = lhs->get_param_types();
|
const std::vector<Type_Info> lhsparamtypes = lhs->get_param_types();
|
||||||
const std::vector<Type_Info> rhsparamtypes = rhs->get_param_types();
|
const std::vector<Type_Info> rhsparamtypes = rhs->get_param_types();
|
||||||
|
|
||||||
const int lhssize = lhsparamtypes.size();
|
const size_t lhssize = lhsparamtypes.size();
|
||||||
const int rhssize = rhsparamtypes.size();
|
const size_t rhssize = rhsparamtypes.size();
|
||||||
|
|
||||||
const Type_Info boxed_type = user_type<Boxed_Value>();
|
const Type_Info boxed_type = user_type<Boxed_Value>();
|
||||||
const Type_Info boxed_pod_type = user_type<Boxed_POD_Value>();
|
const Type_Info boxed_pod_type = user_type<Boxed_POD_Value>();
|
||||||
@@ -843,7 +843,7 @@ namespace chaiscript
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (int i = 1; i < lhssize && i < rhssize; ++i)
|
for (size_t i = 1; i < lhssize && i < rhssize; ++i)
|
||||||
{
|
{
|
||||||
const Type_Info lt = lhsparamtypes[i];
|
const Type_Info lt = lhsparamtypes[i];
|
||||||
const Type_Info rt = rhsparamtypes[i];
|
const Type_Info rt = rhsparamtypes[i];
|
||||||
|
@@ -305,10 +305,10 @@ def string::find_last_not_of(list) : is_type(list, "string") { \n\
|
|||||||
int(find_last_not_of(this, list, -1)); \n\
|
int(find_last_not_of(this, list, -1)); \n\
|
||||||
} \n\
|
} \n\
|
||||||
def string::ltrim() { \n\
|
def string::ltrim() { \n\
|
||||||
drop_while(this, fun(x) { x == ' ' || x == '\t' }); \n\
|
drop_while(this, fun(x) { x == ' ' || x == '\t' || x == '\r' || x == '\n'}); \n\
|
||||||
} \n\
|
} \n\
|
||||||
def string::rtrim() { \n\
|
def string::rtrim() { \n\
|
||||||
reverse(drop_while(reverse(this), fun(x) { x == ' ' || x == '\t' })); \n\
|
reverse(drop_while(reverse(this), fun(x) { x == ' ' || x == '\t' || x == '\r' || x == '\n'})); \n\
|
||||||
} \n\
|
} \n\
|
||||||
def string::trim() { \n\
|
def string::trim() { \n\
|
||||||
ltrim(rtrim(this)); \n\
|
ltrim(rtrim(this)); \n\
|
||||||
|
@@ -10,7 +10,7 @@ def test_function(a)
|
|||||||
|
|
||||||
// test_function tests
|
// test_function tests
|
||||||
assert_equal(test_function.get_arity(), 1);
|
assert_equal(test_function.get_arity(), 1);
|
||||||
assert_equal(test_function.get_annotation(), "#Test Function Description\n");
|
assert_equal(trim(test_function.get_annotation()), "#Test Function Description");
|
||||||
assert_equal(test_function.get_contained_functions().size(), 0);
|
assert_equal(test_function.get_contained_functions().size(), 0);
|
||||||
assert_equal(test_function.get_param_types().size(), 2);
|
assert_equal(test_function.get_param_types().size(), 2);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user