From c368769dca4a0acef8d1e684ebbc8e2f837a2ea8 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Sat, 07 Feb 2026 17:37:36 +0000 Subject: [PATCH] test: add cpp test suite golden overrides --- --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1 @@ +/cpp_test_suite --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.01.jsonnet.golden @@ -0,0 +1,5 @@ +runtime error: foo + error.01.jsonnet:17:29-41: error statement + error.01.jsonnet:18:29-40: function call + error.01.jsonnet:19:28-39: function call + error.01.jsonnet:20:1-11: function call --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.02.jsonnet.golden @@ -0,0 +1,2 @@ +runtime error: Foo. + error.02.jsonnet:17:1-14: error statement --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.03.jsonnet.golden @@ -0,0 +1,3 @@ +runtime error: foo + error.03.jsonnet:17:21-33: error statement + error.03.jsonnet:18:8-10: field access --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.04.jsonnet.golden @@ -0,0 +1,3 @@ +runtime error: foo + error.04.jsonnet:17:21-33: error statement + field evaluation --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.05.jsonnet.golden @@ -0,0 +1,4 @@ +runtime error: foo + error.05.jsonnet:17:21-33: error statement + field evaluation + field manifestification --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.06.jsonnet.golden @@ -0,0 +1,3 @@ +attempted to divide by zero + error.06.jsonnet:18:22-26: local access + error.06.jsonnet:19:1-5: function call \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.07.jsonnet.golden @@ -0,0 +1,4 @@ +runtime error: sarcasm + error.07.jsonnet:18:31-47: error statement + error.07.jsonnet:18:15-55: function call + error.07.jsonnet:19:1-7: local access \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.08.jsonnet.golden @@ -0,0 +1,2 @@ +runtime error: {"a": 1, "b": 2, "c": 3} + error.08.jsonnet:18:1-9: error statement \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.args_commafodder.jsonnet.golden @@ -0,0 +1,2 @@ +local is not defined: foo + error.args_commafodder.jsonnet:1:1-5: local access \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.array_fractional_index.jsonnet.golden @@ -0,0 +1 @@ +tried to index by fractional value \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.array_index_string.jsonnet.golden @@ -0,0 +1 @@ +attempted to index array with string foo \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.array_large_index.jsonnet.golden @@ -0,0 +1 @@ +array out of bounds: 9223372036854775807 is not within [0,3) \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.array_recursive_manifest.jsonnet.golden @@ -0,0 +1,201 @@ +stack overflow, try to reduce recursion, or set --max-stack to bigger value + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification + elem <0> manifestification \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.assert.fail1.jsonnet.golden @@ -0,0 +1,2 @@ +assert failed: null + error.assert.fail1.jsonnet:20:8-15: assertion failure \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.assert.fail2.jsonnet.golden @@ -0,0 +1,2 @@ +assert failed: foo was not equal to bar + error.assert.fail2.jsonnet:20:8-15: assertion failure \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.assert_equal_obj.jsonnet.golden @@ -0,0 +1,8 @@ +runtime error: assertion failed: A != B +A: { + "a": 1 +} +B: { + "b": 1 +} + error.assert_equal_obj.jsonnet:17:1-37: function call \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.assert_equal_str.jsonnet.golden @@ -0,0 +1,11 @@ +runtime error: assertion failed: A != B +A: +one +two + +B: +three +four + + + error.assert_equal_str.jsonnet:17:1-46: function call \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.comprehension_spec_object.jsonnet.golden @@ -0,0 +1 @@ +for loop can only iterate over arrays \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.comprehension_spec_object2.jsonnet.golden @@ -0,0 +1 @@ +for loop can only iterate over arrays \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.computed_field_scope.jsonnet.golden @@ -0,0 +1,3 @@ +local is not defined: x + error.computed_field_scope.jsonnet:17:21-23: local access + error.computed_field_scope.jsonnet:17:21-23: evaluating field name \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.decodeUTF8_float.jsonnet.golden @@ -0,0 +1,3 @@ +runtime error: cannot convert number with fractional part to u8 + argument evaluation + error.decodeUTF8_float.jsonnet:1:1-24: function call \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.decodeUTF8_nan.jsonnet.golden @@ -0,0 +1,4 @@ +type error: expected BoundedNumber<0, 255>, got string at self[0] + array index 0 + argument evaluation + error.decodeUTF8_nan.jsonnet:1:1-25: function call \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.divide_zero.jsonnet.golden @@ -0,0 +1 @@ +attempted to divide by zero \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.equality_function.jsonnet.golden @@ -0,0 +1 @@ +runtime error: cannot test equality of functions \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.field_not_exist.jsonnet.golden @@ -0,0 +1,2 @@ +no such field: y + error.field_not_exist.jsonnet:17:10-12: field access \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.format.too_few_values.jsonnet.golden @@ -0,0 +1,2 @@ +format error: not enough values + std.format of %d %d %d \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.function_duplicate_arg.jsonnet.golden @@ -0,0 +1,2 @@ +argument x is already bound + error.function_duplicate_arg.jsonnet:17:1-30: function call \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.function_duplicate_param.jsonnet.golden @@ -0,0 +1 @@ +runtime error: tried to manifest function \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.function_infinite_default.jsonnet.golden @@ -0,0 +1 @@ +runtime error: tried to manifest function \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.function_no_default_arg.jsonnet.golden @@ -0,0 +1 @@ +runtime error: tried to manifest function \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.function_too_many_args.jsonnet.golden @@ -0,0 +1,3 @@ +too many args, function has 2 +Function has the following signature: (a, b) + error.function_too_many_args.jsonnet:19:1-14: function call \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.import_empty.jsonnet.golden @@ -0,0 +1 @@ +runtime error: special file can't be imported \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.import_static-check-failure.jsonnet.golden @@ -0,0 +1,3 @@ +local is not defined: x + static_check_failure.jsonnet:2:1-3: local access + error.import_static-check-failure.jsonnet:1:1-43: import "lib/static_check_failure.jsonnet" \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.import_syntax-error.jsonnet.golden @@ -0,0 +1,3 @@ +syntax error: expected one of "\\\\", "\\u", "\\x", ['"'], ['\\'], [_], got "EOF" + syntax_error.jsonnet:1:3 + error.import_syntax-error.jsonnet:1:1-35: import "lib/syntax_error.jsonnet" \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.inside_equals_array.jsonnet.golden @@ -0,0 +1,2 @@ +runtime error: foobar + error.inside_equals_array.jsonnet:18:18-33: error statement \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.inside_equals_object.jsonnet.golden @@ -0,0 +1,2 @@ +runtime error: foobar + error.inside_equals_object.jsonnet:18:22-37: error statement \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.inside_tostring_array.jsonnet.golden @@ -0,0 +1,3 @@ +runtime error: foobar + error.inside_tostring_array.jsonnet:17:8-23: error statement + elem <2> evaluation \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.inside_tostring_object.jsonnet.golden @@ -0,0 +1,3 @@ +runtime error: foobar + error.inside_tostring_object.jsonnet:17:12-27: error statement + field evaluation \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.integer_conversion.jsonnet.golden @@ -0,0 +1 @@ +runtime error: numberic value outside of safe integer range for bitwise operation \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.integer_left_shift.jsonnet.golden @@ -0,0 +1 @@ +runtime error: numberic value outside of safe integer range for bitwise operation \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.integer_left_shift_runtime.jsonnet.golden @@ -0,0 +1 @@ +runtime error: left shift would overflow \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.invariant.avoid_output_change.jsonnet.golden @@ -0,0 +1,2 @@ +assert failed: null + error.invariant.avoid_output_change.jsonnet:18:10-25: assertion failure \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.invariant.equality.jsonnet.golden @@ -0,0 +1,2 @@ +assert failed: null + error.invariant.equality.jsonnet:17:10-16: assertion failure \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.invariant.option.jsonnet.golden @@ -0,0 +1,6 @@ +type error: expected array, got string + argument evaluation + error.invariant.option.jsonnet:19:21-56: function call + argument evaluation + error.invariant.option.jsonnet:19:10-57: function call + error.invariant.option.jsonnet:19:10-61: assertion condition \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.invariant.simple.jsonnet.golden @@ -0,0 +1,2 @@ +assert failed: null + error.invariant.simple.jsonnet:18:10-16: assertion failure \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.invariant.simple2.jsonnet.golden @@ -0,0 +1,2 @@ +assert failed: my error message + error.invariant.simple2.jsonnet:18:10-17: assertion failure \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.invariant.simple3.jsonnet.golden @@ -0,0 +1,3 @@ +runtime error: my error message + error.invariant.simple3.jsonnet:18:10-35: error statement + error.invariant.simple3.jsonnet:18:10-35: assertion condition \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.manifest_toml_null_value.jsonnet.golden @@ -0,0 +1,2 @@ +runtime error: tried to manifest null + error.manifest_toml_null_value.jsonnet:17:1-55: function call \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.manifest_toml_wrong_type.jsonnet.golden @@ -0,0 +1,3 @@ +type error: expected object, got array + argument evaluation + error.manifest_toml_wrong_type.jsonnet:17:1-30: function call \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.negative_shfit.jsonnet.golden @@ -0,0 +1 @@ +runtime error: shift by negative exponent \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.obj_assert.fail1.jsonnet.golden @@ -0,0 +1,2 @@ +assert failed: null + error.obj_assert.fail1.jsonnet:20:23-30: assertion failure \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.obj_assert.fail2.jsonnet.golden @@ -0,0 +1,2 @@ +assert failed: foo was not equal to bar + error.obj_assert.fail2.jsonnet:20:23-30: assertion failure \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.obj_recursive.jsonnet.golden @@ -0,0 +1,201 @@ +stack overflow, try to reduce recursion, or set --max-stack to bigger value + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.obj_recursive_manifest.jsonnet.golden @@ -0,0 +1,201 @@ +stack overflow, try to reduce recursion, or set --max-stack to bigger value + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification + field manifestification \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.overflow.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: numbers are finite + error.overflow.jsonnet:17:6 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.overflow2.jsonnet.golden @@ -0,0 +1 @@ +convert num value: non-finite \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.overflow3.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: numbers are finite + error.overflow3.jsonnet:17:6 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.array_comma.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: expected one of "(", ".", "?", "[", "]", "{", , , got "3" + error.parse.array_comma.jsonnet:17:7 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.function_arg_positional_after_named.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: expected one of "(", ".", "?", "[", "{", , , , got ")" + error.parse.function_arg_positional_after_named.jsonnet:19:11 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.import_not_literal.jsonnet.golden @@ -0,0 +1 @@ +runtime error: computed imports are not supported \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.import_text_block.jsonnet.golden @@ -0,0 +1,3 @@ +can't resolve This is a paragraph of text, which is being used in the place of +a filename. That is quite unusual, and probably not intended. + from /home/lach/build/jrsonnet-pr/tests/cpp_test_suite/error.parse.import_text_block.jsonnet \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.index_unterminated.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: expected one of "(", ":", "[", "{", , , , , ['"'], ['\''], got "EOF" + error.parse.index_unterminated.jsonnet:17:4 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.method_plus.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: expected one of ":", "::", ":::", got "+" + error.parse.method_plus.jsonnet:17:18 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.object_comma.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: expected one of "(", ".", "?", "[", "{", "}", , got "z" + error.parse.object_comma.jsonnet:17:11 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.object_comprehension_local_clash.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: expected one of "(", ".", "?", "[", "{", "}", , , got ":" + error.parse.object_comprehension_local_clash.jsonnet:17:29 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.self_in_computed_field.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: expected one of "[", "}", , , ['"'], ['\''], got "s" + error.parse.self_in_computed_field.jsonnet:17:15 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.static_error_bad_number.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: expected one of "(", "[", "{", , , , , ['"'], ['\''], got "." + error.parse.static_error_bad_number.jsonnet:17:1 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.string.invalid_escape.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: expected , got "o" + error.parse.string.invalid_escape.jsonnet:17:3 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.string.invalid_escape_unicode_non_hex.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: expected , got "t" + error.parse.string.invalid_escape_unicode_non_hex.jsonnet:17:7 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.string.invalid_escape_unicode_short.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: expected , got "\n" + error.parse.string.invalid_escape_unicode_short.jsonnet:17:7 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.string.invalid_escape_unicode_short2.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: expected , got "\"" + error.parse.string.invalid_escape_unicode_short2.jsonnet:17:7 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.string.invalid_escape_unicode_short3.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: expected , got "\n" + error.parse.string.invalid_escape_unicode_short3.jsonnet:17:7 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.string.unfinished.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: expected one of "\\\\", "\\u", "\\x", ['"'], ['\\'], [_], got "EOF" + error.parse.string.unfinished.jsonnet:17:3 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.string.unfinished2.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: expected one of "\\\\", "\\u", "\\x", ['\''], ['\\'], [_], got "EOF" + error.parse.string.unfinished2.jsonnet:17:3 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.string_multi_no_newline.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: expected one of "(", "[", "{", , , , , ['"'], ['\''], got "|" + error.parse.string_multi_no_newline.jsonnet:17:1 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.text_block_bad_whitespace.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: expected one of "(", "[", "{", , , , , ['"'], ['\''], got "|" + error.parse.text_block_bad_whitespace.jsonnet:17:1 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.text_block_eof.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: expected one of "(", "[", "{", , , , , ['"'], ['\''], got "|" + error.parse.text_block_eof.jsonnet:17:1 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse.text_block_not_terminated.jsonnet.golden @@ -0,0 +1,2 @@ +syntax error: expected one of "(", "[", "{", , , , , ['"'], ['\''], got "|" + error.parse.text_block_not_terminated.jsonnet:17:1 \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.parse_json.jsonnet.golden @@ -0,0 +1,2 @@ +runtime error: failed to parse json: expected value at line 1 column 1 + error.parse_json.jsonnet:1:1-30: function call \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.recursive_function_nonterm.jsonnet.golden @@ -0,0 +1,201 @@ +stack overflow, try to reduce recursion, or set --max-stack to bigger value + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:18:3-8: function call + error.recursive_function_nonterm.jsonnet:20:1-7: function call \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.recursive_import.jsonnet.golden @@ -0,0 +1,2 @@ +infinite recursion detected + error.recursive_import.jsonnet:17:15-55: import "error.recursive_import.jsonnet" \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.sanity.jsonnet.golden @@ -0,0 +1,4 @@ +runtime error: assertion failed: A != B +A: 1 +B: 2 + error.sanity.jsonnet:17:1-23: function call \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.static_error_self.jsonnet.golden @@ -0,0 +1,2 @@ +self is only usable inside objects + elem <0> evaluation \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.static_error_super.jsonnet.golden @@ -0,0 +1,2 @@ +no super found + elem <0> evaluation \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.static_error_var_not_exist.jsonnet.golden @@ -0,0 +1,3 @@ +local is not defined: tmp2 +There is a local with similar name present: tmp + error.static_error_var_not_exist.jsonnet:17:16-21: local access \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.std_join_types1.jsonnet.golden @@ -0,0 +1,2 @@ +runtime error: in std.join all items should be strings + error.std_join_types1.jsonnet:17:1-27: function call \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.std_join_types2.jsonnet.golden @@ -0,0 +1,2 @@ +runtime error: in std.join all items should be arrays + error.std_join_types2.jsonnet:17:1-32: function call \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.std_makeArray_negative.jsonnet.golden @@ -0,0 +1,3 @@ +type error: number out of bounds: -10 not in 0..2147483647 + argument evaluation + error.std_makeArray_negative.jsonnet:17:1-38: function call \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.std_maxArray.jsonnet.golden @@ -0,0 +1,2 @@ +runtime error: expected non-empty array + error.std_maxArray.jsonnet:1:1-18: function call \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.std_minArray.jsonnet.golden @@ -0,0 +1,2 @@ +runtime error: expected non-empty array + error.std_minArray.jsonnet:1:1-18: function call \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.std_parseJson.nodigitsep.jsonnet.golden @@ -0,0 +1,2 @@ +runtime error: failed to parse json: trailing characters at line 1 column 4 + error.std_parseJson.nodigitsep.jsonnet:1:1-26: function call \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.top_level_func.jsonnet.golden @@ -0,0 +1 @@ +runtime error: tried to manifest function \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.trace_three_param.jsonnet.golden @@ -0,0 +1,5 @@ +too many args, function has 2 +Function has the following signature: (str, rest = ) + error.trace_three_param.jsonnet:17:11-33: function call + error.trace_three_param.jsonnet:19:6-8: local access + field evaluation \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.trace_zero_param.jsonnet.golden @@ -0,0 +1,5 @@ +function argument is not passed: str +Function has the following signature: (str, rest = ) + error.trace_zero_param.jsonnet:17:11-23: function call + error.trace_zero_param.jsonnet:19:6-8: local access + field evaluation \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.verbatim_import.jsonnet.golden @@ -0,0 +1 @@ +can't resolve C:\can't possibly exist~ from /home/lach/build/jrsonnet-pr/tests/cpp_test_suite/error.verbatim_import.jsonnet \ No newline at end of file --- /dev/null +++ b/tests/cpp_test_suite_golden_override/error.wrong_type.jsonnet.golden @@ -0,0 +1,3 @@ +type error: expected char, got number + argument evaluation + error.wrong_type.jsonnet:1:1-19: function call \ No newline at end of file --- /dev/null +++ b/tests/tests/cpp_test_suite.rs @@ -0,0 +1,175 @@ +use std::{ + env, fs, + io::{self, ErrorKind}, + path::{Path, PathBuf}, +}; + +use jrsonnet_evaluator::{ + apply_tla, + function::TlaArg, + gc::WithCapacityExt as _, + manifest::JsonFormat, + rustc_hash::FxHashMap, + trace::{CompactFormat, PathResolver, TraceFormat}, + FileImportResolver, IStr, ObjValueBuilder, State, Val, +}; +use jrsonnet_stdlib::ContextInitializer; +mod common; +use common::ContextInitializer as TestContextInitializer; + +fn run(file: &Path, root: &Path) -> String { + let mut s = State::builder(); + + let std_context = ContextInitializer::new(PathResolver::Relative(root.to_owned())); + std_context.add_ext_str("var1".into(), "test".into()); + std_context + .add_ext_code("var2".into(), "{x:1,y:2}") + .expect("code is valid"); + + s.context_initializer((std_context, TestContextInitializer)) + .import_resolver(FileImportResolver::default()); + let s = s.build(); + + let trace_format = CompactFormat { + resolver: PathResolver::FileName, + max_trace: 20, + padding: 4, + }; + + let mut v = match s.import(file) { + Ok(v) => v, + Err(e) => return trace_format.format(&e).unwrap(), + }; + + if file + .file_name() + .expect("file has basename") + .to_str() + .expect("jsonnet testsuite has ascii names") + .starts_with("tla.") + { + let mut args = FxHashMap::new(); + args.insert(IStr::from("var1"), TlaArg::String("test".into())); + args.insert( + IStr::from("var2"), + TlaArg::Val({ + let mut o = ObjValueBuilder::new(); + + o.field("x").value(Val::num(1)); + o.field("y").value(Val::num(2)); + + Val::Obj(o.build()) + }), + ); + v = apply_tla(s, &args, v).expect("failed to apply tla"); + } + + match v.manifest(JsonFormat::default()) { + Ok(v) => v, + Err(e) => trace_format.format(&e).unwrap(), + } +} + +fn read_file(path: &Path) -> io::Result> { + match fs::read_to_string(path) { + Ok(v) => Ok(Some(v)), + Err(e) if e.kind() == ErrorKind::NotFound => Ok(None), + Err(e) => Err(e), + } +} + +const SKIPPED: &[&str] = &[ + // Parser fails with stack overflow. While is a bug, this is a too unusual + // thing to run untrusted jsonnet code? Will be fixed with nom/rowan. + "error.parse.deep_array_nesting.jsonnet", + // Runtime error in jrsonnet + "error.parse.object_local_clash.jsonnet", + // Too slow to throw due to how lazyness is implemented in jrsonnet + "error.recursive_object_non_term.jsonnet", + // In jrsonnet returns the one passed argument, works as Rust's dbg!() + "error.trace_one_param.jsonnet", + // In jrsonnet can display any value + "error.trace_two_param.jsonnet", + // Depends on unsafe handling of strings as arrays in jsonnet stdlib + "invariant_manifest.jsonnet", + // Little bit hard to capture trace logs in this test suite at this moment + "trace.jsonnet", +]; + +#[test] +fn cpp_test_suite() -> io::Result<()> { + use json_structural_diff::JsonDiff; + + let root_tests = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + let root = root_tests.join("cpp_test_suite"); + let root_override = root_tests.join("cpp_test_suite_golden_override"); + + for entry in fs::read_dir(&root).map_err(|e| io::Error::new(ErrorKind::Other, format!("failed to enumerate cpp_test_suite dir (Note: it needs to be cloned from C++ jsonnet repo for this test): {e}")))? { + let entry = entry?; + if !entry.path().extension().map_or(false, |e| e == "jsonnet") { + continue; + } + + if entry + .path() + .file_name() + .and_then(|v| v.to_str()) + .map_or(false, |v| SKIPPED.contains(&v)) + { + continue; + } + + let result = run(&entry.path(), &root); + + let mut golden_path = entry.path(); + golden_path.set_extension("jsonnet.golden"); + let golden_override = + root_override.join(&golden_path.file_name().expect("file has basename")); + + let mut golden = read_file(&golden_path)?; + + if let Some(golden_path) = read_file(&golden_override)? { + golden = Some(golden_path); + } + + let golden = golden.unwrap_or_else(|| "true".to_owned()); + + match (serde_json::from_str(&result), serde_json::from_str(&golden)) { + (Err(_), Ok(_)) => panic!( + "unexpected error for golden {}:\n\n{result}\n\n\n{golden}\n", + entry.path().display() + ), + (Ok(_), Err(_)) => panic!( + "expected error for golden {}:\n\n{result}\n\n\n{golden}\n", + entry.path().display() + ), + (Ok(result), Ok(golden)) => { + // Show diff relative to golden`. + let diff = JsonDiff::diff_string(&golden, &result, false); + if let Some(diff) = diff { + panic!( + "Result \n{result:#}\n\ + and golden \n{golden:#}\n\ + did not match structurally:\n{diff:#}\n\ + for golden {}", + entry.path().display() + ); + } + } + (Err(_), Err(_)) => { + if result != golden.trim_end() { + if env::var_os("UPDATE_GOLDEN").is_some() { + fs::write(golden_override, result)?; + } else { + panic!( + "golden didn't match for {}:\n\n{result}\n\n\n{golden}\n", + entry.path().display() + ) + } + } + } + }; + } + + Ok(()) +} -- gitstuff