diff --git a/resources/tests/module/std/prepend.clinc b/resources/tests/module/std/prepend.clinc new file mode 100644 index 00000000..50c37867 --- /dev/null +++ b/resources/tests/module/std/prepend.clinc @@ -0,0 +1,6 @@ +(defun prepend (a b) + (if a + (c (f a) (prepend (r a) b)) + b + ) +) diff --git a/resources/tests/module/test_prepend.clsp b/resources/tests/module/test_prepend.clsp new file mode 100644 index 00000000..2a652437 --- /dev/null +++ b/resources/tests/module/test_prepend.clsp @@ -0,0 +1,4 @@ +(include *standard-cl-23*) + +(import std.prepend) +(export (X Y) (prepend X Y)) diff --git a/src/tests/compiler/modules.rs b/src/tests/compiler/modules.rs index 97b85cc3..75a3afab 100644 --- a/src/tests/compiler/modules.rs +++ b/src/tests/compiler/modules.rs @@ -387,3 +387,20 @@ fn test_simple_module_compliation_simple_type_2() { }], ); } + +#[test] +fn test_function_with_argument_names_overlapping_primitives() { + let filename = "resources/tests/module/test_prepend.clsp"; + let content = fs::read_to_string(filename).expect("file should exist"); + let hex_filename = "resources/tests/module/test_prepend.hex"; + + test_compile_and_run_program_with_modules( + filename, + &content, + &[HexArgumentOutcome { + hexfile: hex_filename, + argument: "((1 2 3) (4 5 6))", + outcome: Some("(q 2 3 4 5 6)"), + }], + ); +}