finished test suite up to current state

This commit is contained in:
Moritz Gmeiner 2024-08-26 17:27:12 +02:00
commit 6de93de529

View file

@ -60,7 +60,6 @@ file assignment/grouping.lox
file assignment/infix_operator.lox file assignment/infix_operator.lox
$ mlox assignment/infix_operator.lox $ mlox assignment/infix_operator.lox
Invalid assignment target
found 1 ParserError: found 1 ParserError:
ParserError at line 3, column 6: Invalid assignment target ParserError at line 3, column 6: Invalid assignment target
[1] [1]
@ -76,7 +75,6 @@ file assignment/local.lox
file assignment/prefix_operator.lox file assignment/prefix_operator.lox
$ mlox assignment/prefix_operator.lox $ mlox assignment/prefix_operator.lox
Invalid assignment target
found 1 ParserError: found 1 ParserError:
ParserError at line 2, column 3: Invalid assignment target ParserError at line 2, column 3: Invalid assignment target
[1] [1]
@ -90,7 +88,6 @@ file assignment/syntax.lox
file assignment/to_this.lox file assignment/to_this.lox
$ mlox assignment/to_this.lox $ mlox assignment/to_this.lox
[1]
file assignment/undefined.lox file assignment/undefined.lox
@ -141,78 +138,58 @@ file bool/not.lox
file call/bool.lox file call/bool.lox
$ mlox call/bool.lox $ mlox call/bool.lox
[1]
file call/nil.lox file call/nil.lox
$ mlox call/nil.lox $ mlox call/nil.lox
[1]
file call/num.lox file call/num.lox
$ mlox call/num.lox $ mlox call/num.lox
[1]
file call/object.lox file call/object.lox
$ mlox call/object.lox $ mlox call/object.lox
[1]
file call/string.lox file call/string.lox
$ mlox call/string.lox $ mlox call/string.lox
[1]
file class/empty.lox file class/empty.lox
$ mlox class/empty.lox $ mlox class/empty.lox
Foo
file class/inherit_self.lox file class/inherit_self.lox
$ mlox class/inherit_self.lox $ mlox class/inherit_self.lox
[1]
file class/inherited_method.lox file class/inherited_method.lox
$ mlox class/inherited_method.lox $ mlox class/inherited_method.lox
in foo
in bar
in baz
file class/local_inherit_other.lox file class/local_inherit_other.lox
$ mlox class/local_inherit_other.lox $ mlox class/local_inherit_other.lox
B
file class/local_inherit_self.lox file class/local_inherit_self.lox
$ mlox class/local_inherit_self.lox $ mlox class/local_inherit_self.lox
[1]
file class/local_reference_self.lox file class/local_reference_self.lox
$ mlox class/local_reference_self.lox $ mlox class/local_reference_self.lox
Foo
file class/reference_self.lox file class/reference_self.lox
$ mlox class/reference_self.lox $ mlox class/reference_self.lox
Foo
file closure/assign_to_closure.lox file closure/assign_to_closure.lox
$ mlox closure/assign_to_closure.lox $ mlox closure/assign_to_closure.lox
local
after f
after f
after g
file closure/assign_to_shadowed_later.lox file closure/assign_to_shadowed_later.lox
$ mlox closure/assign_to_shadowed_later.lox $ mlox closure/assign_to_shadowed_later.lox
inner
assigned
file closure/close_over_function_parameter.lox file closure/close_over_function_parameter.lox
@ -261,6 +238,7 @@ file closure/unused_later_closure.lox
file comments/line_at_eof.lox file comments/line_at_eof.lox
$ mlox comments/line_at_eof.lox $ mlox comments/line_at_eof.lox
ok
file comments/only_line_comment.lox file comments/only_line_comment.lox
@ -273,6 +251,7 @@ file comments/only_line_comment_and_line.lox
file comments/unicode.lox file comments/unicode.lox
$ mlox comments/unicode.lox $ mlox comments/unicode.lox
ok
file constructor/arguments.lox file constructor/arguments.lox
@ -525,10 +504,14 @@ file if/class_in_then.lox
file if/dangling_else.lox file if/dangling_else.lox
$ mlox if/dangling_else.lox $ mlox if/dangling_else.lox
good
file if/else.lox file if/else.lox
$ mlox if/else.lox $ mlox if/else.lox
good
good
block
file if/fun_in_else.lox file if/fun_in_else.lox
@ -541,18 +524,32 @@ file if/fun_in_then.lox
file if/if.lox file if/if.lox
$ mlox if/if.lox $ mlox if/if.lox
good
block
true
file if/truth.lox file if/truth.lox
$ mlox if/truth.lox $ mlox if/truth.lox
false
nil
true
0
empty
file if/var_in_else.lox file if/var_in_else.lox
$ mlox if/var_in_else.lox $ mlox if/var_in_else.lox
found 1 ParserError:
ParserError at line 2, column 21: Expected valid expression, got Var instead
[1]
file if/var_in_then.lox file if/var_in_then.lox
$ mlox if/var_in_then.lox $ mlox if/var_in_then.lox
found 1 ParserError:
ParserError at line 2, column 10: Expected valid expression, got Var instead
[1]
file inheritance/constructor.lox file inheritance/constructor.lox
@ -609,18 +606,42 @@ file limit/too_many_upvalues.lox
file logical_operator/and.lox file logical_operator/and.lox
$ mlox logical_operator/and.lox $ mlox logical_operator/and.lox
false
1
false
true
3
true
false
file logical_operator/and_truth.lox file logical_operator/and_truth.lox
$ mlox logical_operator/and_truth.lox $ mlox logical_operator/and_truth.lox
false
nil
ok
ok
ok
file logical_operator/or.lox file logical_operator/or.lox
$ mlox logical_operator/or.lox $ mlox logical_operator/or.lox
1
1
true
false
false
false
true
file logical_operator/or_truth.lox file logical_operator/or_truth.lox
$ mlox logical_operator/or_truth.lox $ mlox logical_operator/or_truth.lox
ok
ok
true
0
s
file method/arity.lox file method/arity.lox
@ -661,22 +682,41 @@ file method/too_many_parameters.lox
file nil/literal.lox file nil/literal.lox
$ mlox nil/literal.lox $ mlox nil/literal.lox
nil
file number/decimal_point_at_eof.lox file number/decimal_point_at_eof.lox
$ mlox number/decimal_point_at_eof.lox $ mlox number/decimal_point_at_eof.lox
found 1 ParserError:
ParserError at line 2, column 4: Expected Semicolon, but got Eof
[1]
file number/leading_dot.lox file number/leading_dot.lox
$ mlox number/leading_dot.lox $ mlox number/leading_dot.lox
found 1 ParserError:
ParserError at line 2, column 0: Expected valid expression, got Dot instead
[1]
file number/literals.lox file number/literals.lox
$ mlox number/literals.lox $ mlox number/literals.lox
123
987654
0
0
123.456
-0.001
file number/nan_equality.lox file number/nan_equality.lox
$ mlox number/nan_equality.lox $ mlox number/nan_equality.lox
RuntimeError at line 1, column 11: Division by 0
[1]
false
true
false
true
file number/trailing_dot.lox file number/trailing_dot.lox
@ -685,50 +725,100 @@ file number/trailing_dot.lox
file operator/add.lox file operator/add.lox
$ mlox operator/add.lox $ mlox operator/add.lox
579
string
file operator/add_bool_nil.lox file operator/add_bool_nil.lox
$ mlox operator/add_bool_nil.lox $ mlox operator/add_bool_nil.lox
RuntimeError at line 1, column 5: Invalid operands of type Bool and Nil to operator Plus
[1]
file operator/add_bool_num.lox file operator/add_bool_num.lox
$ mlox operator/add_bool_num.lox $ mlox operator/add_bool_num.lox
RuntimeError at line 1, column 5: Invalid operands of type Bool and Number to operator Plus
[1]
file operator/add_bool_string.lox file operator/add_bool_string.lox
$ mlox operator/add_bool_string.lox $ mlox operator/add_bool_string.lox
RuntimeError at line 1, column 5: Invalid operands of type Bool and String to operator Plus
[1]
file operator/add_nil_nil.lox file operator/add_nil_nil.lox
$ mlox operator/add_nil_nil.lox $ mlox operator/add_nil_nil.lox
RuntimeError at line 1, column 4: Invalid operands of type Nil and Nil to operator Plus
[1]
file operator/add_num_nil.lox file operator/add_num_nil.lox
$ mlox operator/add_num_nil.lox $ mlox operator/add_num_nil.lox
RuntimeError at line 1, column 2: Invalid operands of type Number and Nil to operator Plus
[1]
file operator/add_string_nil.lox file operator/add_string_nil.lox
$ mlox operator/add_string_nil.lox $ mlox operator/add_string_nil.lox
RuntimeError at line 1, column 4: Invalid operands of type String and Nil to operator Plus
[1]
file operator/comparison.lox file operator/comparison.lox
$ mlox operator/comparison.lox $ mlox operator/comparison.lox
true
false
false
true
true
false
false
false
true
false
true
true
false
false
false
false
true
true
true
true
file operator/divide.lox file operator/divide.lox
$ mlox operator/divide.lox $ mlox operator/divide.lox
4
1
file operator/divide_nonnum_num.lox file operator/divide_nonnum_num.lox
$ mlox operator/divide_nonnum_num.lox $ mlox operator/divide_nonnum_num.lox
RuntimeError at line 1, column 4: Invalid operands of type String and Number to operator Div
[1]
file operator/divide_num_nonnum.lox file operator/divide_num_nonnum.lox
$ mlox operator/divide_num_nonnum.lox $ mlox operator/divide_num_nonnum.lox
RuntimeError at line 1, column 2: Invalid operands of type Number and String to operator Div
[1]
file operator/equals.lox file operator/equals.lox
$ mlox operator/equals.lox $ mlox operator/equals.lox
true
true
false
true
false
true
false
false
false
false
file operator/equals_class.lox file operator/equals_class.lox
@ -741,54 +831,81 @@ file operator/equals_method.lox
file operator/greater_nonnum_num.lox file operator/greater_nonnum_num.lox
$ mlox operator/greater_nonnum_num.lox $ mlox operator/greater_nonnum_num.lox
RuntimeError at line 1, column 4: Invalid operands of type String and Number to operator Greater
[1]
file operator/greater_num_nonnum.lox file operator/greater_num_nonnum.lox
$ mlox operator/greater_num_nonnum.lox $ mlox operator/greater_num_nonnum.lox
RuntimeError at line 1, column 2: Invalid operands of type Number and String to operator Greater
[1]
file operator/greater_or_equal_nonnum_num.lox file operator/greater_or_equal_nonnum_num.lox
$ mlox operator/greater_or_equal_nonnum_num.lox $ mlox operator/greater_or_equal_nonnum_num.lox
RuntimeError at line 1, column 4: Invalid operands of type String and Number to operator GreaterEqual
[1]
file operator/greater_or_equal_num_nonnum.lox file operator/greater_or_equal_num_nonnum.lox
$ mlox operator/greater_or_equal_num_nonnum.lox $ mlox operator/greater_or_equal_num_nonnum.lox
RuntimeError at line 1, column 2: Invalid operands of type Number and String to operator GreaterEqual
[1]
file operator/less_nonnum_num.lox file operator/less_nonnum_num.lox
$ mlox operator/less_nonnum_num.lox $ mlox operator/less_nonnum_num.lox
RuntimeError at line 1, column 4: Invalid operands of type String and Number to operator Less
[1]
file operator/less_num_nonnum.lox file operator/less_num_nonnum.lox
$ mlox operator/less_num_nonnum.lox $ mlox operator/less_num_nonnum.lox
RuntimeError at line 1, column 2: Invalid operands of type Number and String to operator Less
[1]
file operator/less_or_equal_nonnum_num.lox file operator/less_or_equal_nonnum_num.lox
$ mlox operator/less_or_equal_nonnum_num.lox $ mlox operator/less_or_equal_nonnum_num.lox
RuntimeError at line 1, column 4: Invalid operands of type String and Number to operator LessEqual
[1]
file operator/less_or_equal_num_nonnum.lox file operator/less_or_equal_num_nonnum.lox
$ mlox operator/less_or_equal_num_nonnum.lox $ mlox operator/less_or_equal_num_nonnum.lox
RuntimeError at line 1, column 2: Invalid operands of type Number and String to operator LessEqual
[1]
file operator/multiply.lox file operator/multiply.lox
$ mlox operator/multiply.lox $ mlox operator/multiply.lox
15
3.702
file operator/multiply_nonnum_num.lox file operator/multiply_nonnum_num.lox
$ mlox operator/multiply_nonnum_num.lox $ mlox operator/multiply_nonnum_num.lox
RuntimeError at line 1, column 4: Invalid operands of type String and Number to operator Mul
[1]
file operator/multiply_num_nonnum.lox file operator/multiply_num_nonnum.lox
$ mlox operator/multiply_num_nonnum.lox $ mlox operator/multiply_num_nonnum.lox
RuntimeError at line 1, column 2: Invalid operands of type Number and String to operator Mul
[1]
file operator/negate.lox file operator/negate.lox
$ mlox operator/negate.lox $ mlox operator/negate.lox
-3
3
-3
file operator/negate_nonnum.lox file operator/negate_nonnum.lox
$ mlox operator/negate_nonnum.lox $ mlox operator/negate_nonnum.lox
RuntimeError at line 1, column 0: Invalid operant of type String to operator Neg
[1]
file operator/not.lox file operator/not.lox
@ -801,26 +918,41 @@ file operator/not_class.lox
file operator/not_equals.lox file operator/not_equals.lox
$ mlox operator/not_equals.lox $ mlox operator/not_equals.lox
false
false
true
false
true
false
true
true
true
true
file operator/subtract.lox file operator/subtract.lox
$ mlox operator/subtract.lox $ mlox operator/subtract.lox
1
0
file operator/subtract_nonnum_num.lox file operator/subtract_nonnum_num.lox
$ mlox operator/subtract_nonnum_num.lox $ mlox operator/subtract_nonnum_num.lox
RuntimeError at line 1, column 4: Invalid operands of type String and Number to operator Minus
[1]
file operator/subtract_num_nonnum.lox file operator/subtract_num_nonnum.lox
$ mlox operator/subtract_num_nonnum.lox $ mlox operator/subtract_num_nonnum.lox
RuntimeError at line 1, column 2: Invalid operands of type Number and String to operator Minus
[1]
file precedence.lox
$ mlox precedence.lox
file print/missing_argument.lox file print/missing_argument.lox
$ mlox print/missing_argument.lox $ mlox print/missing_argument.lox
found 1 ParserError:
ParserError at line 2, column 5: Expected valid expression, got Semicolon instead
[1]
file regression/40.lox file regression/40.lox
@ -885,14 +1017,22 @@ file scanning/whitespace.lox
file string/error_after_multiline.lox file string/error_after_multiline.lox
$ mlox string/error_after_multiline.lox $ mlox string/error_after_multiline.lox
RuntimeError at line 7, column 0: name "err" is not defined
[1]
file string/literals.lox file string/literals.lox
$ mlox string/literals.lox $ mlox string/literals.lox
()
a string
A~Þॐஃ
file string/multiline.lox file string/multiline.lox
$ mlox string/multiline.lox $ mlox string/multiline.lox
1
2
3
file string/unterminated.lox file string/unterminated.lox
@ -1012,6 +1152,8 @@ file variable/collide_with_parameter.lox
file variable/duplicate_local.lox file variable/duplicate_local.lox
$ mlox variable/duplicate_local.lox $ mlox variable/duplicate_local.lox
RuntimeError at line 3, column 2: Tried to define a, but was already defined
[1]
file variable/duplicate_parameter.lox file variable/duplicate_parameter.lox
@ -1024,10 +1166,15 @@ file variable/early_bound.lox
file variable/in_middle_of_block.lox file variable/in_middle_of_block.lox
$ mlox variable/in_middle_of_block.lox $ mlox variable/in_middle_of_block.lox
a
a b
a c
a b d
file variable/in_nested_block.lox file variable/in_nested_block.lox
$ mlox variable/in_nested_block.lox $ mlox variable/in_nested_block.lox
outer
file variable/local_from_method.lox file variable/local_from_method.lox
@ -1036,62 +1183,89 @@ file variable/local_from_method.lox
file variable/redeclare_global.lox file variable/redeclare_global.lox
$ mlox variable/redeclare_global.lox $ mlox variable/redeclare_global.lox
nil
file variable/redefine_global.lox file variable/redefine_global.lox
$ mlox variable/redefine_global.lox $ mlox variable/redefine_global.lox
2
file variable/scope_reuse_in_different_blocks.lox file variable/scope_reuse_in_different_blocks.lox
$ mlox variable/scope_reuse_in_different_blocks.lox $ mlox variable/scope_reuse_in_different_blocks.lox
first
second
file variable/shadow_and_local.lox file variable/shadow_and_local.lox
$ mlox variable/shadow_and_local.lox $ mlox variable/shadow_and_local.lox
outer
inner
file variable/shadow_global.lox file variable/shadow_global.lox
$ mlox variable/shadow_global.lox $ mlox variable/shadow_global.lox
shadow
global
file variable/shadow_local.lox file variable/shadow_local.lox
$ mlox variable/shadow_local.lox $ mlox variable/shadow_local.lox
shadow
local
file variable/undefined_global.lox file variable/undefined_global.lox
$ mlox variable/undefined_global.lox $ mlox variable/undefined_global.lox
RuntimeError at line 1, column 6: name "notDefined" is not defined
[1]
file variable/undefined_local.lox file variable/undefined_local.lox
$ mlox variable/undefined_local.lox $ mlox variable/undefined_local.lox
RuntimeError at line 2, column 8: name "notDefined" is not defined
[1]
file variable/uninitialized.lox file variable/uninitialized.lox
$ mlox variable/uninitialized.lox $ mlox variable/uninitialized.lox
nil
file variable/unreached_undefined.lox file variable/unreached_undefined.lox
$ mlox variable/unreached_undefined.lox $ mlox variable/unreached_undefined.lox
ok
file variable/use_false_as_var.lox file variable/use_false_as_var.lox
$ mlox variable/use_false_as_var.lox $ mlox variable/use_false_as_var.lox
found 1 ParserError:
ParserError at line 2, column 4: Expected identifier, but got False
[1]
file variable/use_global_in_initializer.lox file variable/use_global_in_initializer.lox
$ mlox variable/use_global_in_initializer.lox $ mlox variable/use_global_in_initializer.lox
value
TODO: what to do here?
file variable/use_local_in_initializer.lox file variable/use_local_in_initializer.lox
$ mlox variable/use_local_in_initializer.lox $ mlox variable/use_local_in_initializer.lox
file variable/use_nil_as_var.lox file variable/use_nil_as_var.lox
$ mlox variable/use_nil_as_var.lox $ mlox variable/use_nil_as_var.lox
found 1 ParserError:
ParserError at line 2, column 4: Expected identifier, but got Nil
[1]
file variable/use_this_as_var.lox file variable/use_this_as_var.lox
$ mlox variable/use_this_as_var.lox $ mlox variable/use_this_as_var.lox
found 1 ParserError:
ParserError at line 2, column 4: Expected identifier, but got This
[1]
file while/class_in_body.lox file while/class_in_body.lox