public void test_domain_error(string s, EErrorCodes e) => Tester.ThrowTest(s, e);
public void test_basic_error_throwing(string s, EErrorCodes e) => Tester.ThrowTest(s, e);
public void test_unexpected_operator() { // unexpected operator Tester.ThrowTest("5+*3)", EErrorCodes.ecUNEXPECTED_OPERATOR); }
public void test_issue25() { Tester.ThrowTest("55<<2222222222", EErrorCodes.ecOVERFLOW); // Changed to longer number to overflow on 64bit }
public void test_binary_op_type_conflicts(string s, EErrorCodes e, int i) => Tester.ThrowTest(s, e, i);
public void test_unexpected_parens(string s, EErrorCodes e) => Tester.ThrowTest(s, e);
[DataRow("(va*vb)*b", EErrorCodes.ecMATRIX_DIMENSION_MISMATCH)] // fail: matrix dimension mismatch public void test_vector_dimension_mismatch(string s, EErrorCodes e) => Tester.ThrowTest(s, e);
public void test_invalid_function_arguments(string s, EErrorCodes e, int i) => Tester.ThrowTest(s, e, i);
public void test_assignment_to_element_throwing() => Tester.ThrowTest("va'[0]=123", EErrorCodes.ecASSIGNEMENT_TO_VALUE);
[DataRow("10+va*2", EErrorCodes.ecEVAL)] // fail: number + vector public void test_vector_operations(string s, EErrorCodes e) => Tester.ThrowTest(s, e);
public void test_eye_error_throwing() => Tester.ThrowTest("eye()", EErrorCodes.ecINVALID_NUMBER_OF_PARAMETERS);
public void test_ones_EErrorCodes(string s, EErrorCodes e) => Tester.ThrowTest(s, e);
public void test_matrix_dimension_mismatch_error(string s, EErrorCodes e) => Tester.ThrowTest(s, e);
public void test_index_out_of_bounds(string s, EErrorCodes e) => Tester.ThrowTest(s, e);
[DataRow("a[1]", EErrorCodes.ecINDEX_OUT_OF_BOUNDS)] // indexing a scalar is ok, but this index is out of bounds (0 would be ok...) public void test_vector_index_bounds(string s, EErrorCodes e) => Tester.ThrowTest(s, e);
public void test_try_assign_nonexistent_var() { Tester.ThrowTest("sin(nonexistent_var)", EErrorCodes.ecUNASSIGNABLE_TOKEN, 4, "nonexistent_var"); }
[DataRow("va[sin(8)]", EErrorCodes.ecTYPE_CONFLICT_IDX, -1)] // fail: float value used as index public void test_vector_index_type_conflict(string s, EErrorCodes e, int i = -1) => Tester.ThrowTest(s, e, i);
public void test_invalid_unary_operator_arguments(string s, EErrorCodes e, int p) => Tester.ThrowTest(s, e, p);
public void test_vector_malformed_brackets(string s, EErrorCodes e) => Tester.ThrowTest(s, e);
public void test_unexpected_end_of_expression(string s, EErrorCodes e) => Tester.ThrowTest(s, e);
public void test_unexpeted_comma(string s, EErrorCodes e) => Tester.ThrowTest(s, e);
public void test_unassignable_token(string s, EErrorCodes e) => Tester.ThrowTest(s, e);
public void test_unexpected_variable() { // unexpected variable // if a variable factory is installed ecUNEXPECTED_VAR Tester.ThrowTest("a _xxx_ b", EErrorCodes.ecUNASSIGNABLE_TOKEN, 2); }
public void test_missing_params(string s, EErrorCodes e) => Tester.ThrowTest(s, e);
[DataRow("a+0x", EErrorCodes.ecUNASSIGNABLE_TOKEN)] // incomplete hex value public void test_value_recognition(string s, EErrorCodes e) => Tester.ThrowTest(s, e);
public void test_error_detection(string s, EErrorCodes e) => Tester.ThrowTest(s, e);
public void test_boolean_throw_undefined() { Tester.ThrowTest("0b10000000000000000000000000000000000000000000000000000000000000001", EErrorCodes.ecCONVERSION_OVERFLOW); }