From e8ab131a2b54aa4252ccda3261a0a6a2ade6a273 Mon Sep 17 00:00:00 2001 From: Arnaud Bailly Date: Tue, 8 Oct 2024 22:32:44 +0200 Subject: Generate nested binary applications Also factor out common strategies into functions --- rust/src/web.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'rust/src/web.rs') diff --git a/rust/src/web.rs b/rust/src/web.rs index af27eda..3d9fcda 100644 --- a/rust/src/web.rs +++ b/rust/src/web.rs @@ -431,6 +431,22 @@ mod app_tests { } } + #[test] + async fn client_generates_nested_applications_and_constants_at_level_5() { + let mut client = client(); + client.grade = 5; + + let (input, _) = client.generate_expr(); + + let parsed = parse(&input); + match &parsed[..] { + [Value::App(_, _)] => (), + [Value::Sym(_)] => (), + [Value::Num(_)] => (), + _ => panic!("Expected symbol, got {:?}", parsed), + } + } + #[test] async fn client_increases_grade_on_successful_test() { let mut client = client(); -- cgit v1.2.3