Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add list to tree feature #49

Closed
wants to merge 12 commits into from
Prev Previous commit
Next Next commit
add one more test
matt-o-how committed Oct 10, 2023
commit 5dd8894dc1b81e73884a96e80034f60d8b869d84
12 changes: 12 additions & 0 deletions src/tests/compiler/compiler.rs
Original file line number Diff line number Diff line change
@@ -226,6 +226,18 @@ fn compile_test_15() {
assert_eq!(result.to_string(), "90".to_string());
}

// use structured list in solution
#[test]
fn compile_test_16() {
let result = run_string_maybe_opt(
&"(mod #(a b c) (- (+ a c) b))".to_string(),
&"#(100 20 10)".to_string(),
true,
)
.unwrap();
assert_eq!(result.to_string(), "90".to_string());
}

fn run_test_1_maybe_opt(opt: bool) {
let result = run_string_maybe_opt(
&"(mod () (defun f (a b) (+ (* a a) b)) (f 3 1))".to_string(),