From e4af8559784e851047702045ff677c9a91897fdd Mon Sep 17 00:00:00 2001 From: Arnaud Bailly Date: Wed, 9 Oct 2024 09:38:52 +0200 Subject: [wip] client generates applications with more than 2 terms --- rust/src/web.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'rust/src/web.rs') diff --git a/rust/src/web.rs b/rust/src/web.rs index de87ad6..8fa9452 100644 --- a/rust/src/web.rs +++ b/rust/src/web.rs @@ -464,6 +464,30 @@ mod app_tests { } } + #[test] + async fn client_generates_application_with_lambda_terms_at_level_7() { + let mut client = client(); + client.grade = 7; + + let (input, _) = client.generate_expr(); + + let parsed = parse(&input); + match &parsed[..] { + [Value::App(t1, _)] if matches!(**t1, Value::Lam(_, _)) => (), + _ => panic!("Expected symbol, got {:?}", parsed), + } + } + + #[test] + async fn client_generates_applications_with_more_than_2_terms_at_level_8() { + let mut client = client(); + client.grade = 8; + + let (input, _) = client.generate_expr(); + + assert!(input.split(' ').count() > 2); + } + #[test] async fn client_increases_grade_on_successful_test() { let mut client = client(); -- cgit v1.2.3