diff --git a/tests/call_arg_eval_context.fl b/tests/call_arg_eval_context.fl new file mode 100644 index 0000000..3cf2ce1 --- /dev/null +++ b/tests/call_arg_eval_context.fl @@ -0,0 +1,9 @@ +# Regression test. +# When calling a function that is defined in a different source file, the context's source could be switched to the source file of the function being called before the argument expressions are evaluated. +# This would cause these evaluations to use the wrong source file. + +# TODO rename this + +import .tests.call_arg_eval_context_helper + +assert function("zonnebloemgranen") == "zonnebloemgranen" diff --git a/tests/call_arg_eval_context_helper.fl b/tests/call_arg_eval_context_helper.fl new file mode 100644 index 0000000..b97f5a9 --- /dev/null +++ b/tests/call_arg_eval_context_helper.fl @@ -0,0 +1,3 @@ +fn function(x) { + return x +}