summaryrefslogtreecommitdiff
path: root/rust/src/web.rs
diff options
context:
space:
mode:
authorArnaud Bailly <arnaud.bailly@iohk.io>2024-10-09 09:38:52 +0200
committerArnaud Bailly <arnaud.bailly@iohk.io>2024-10-09 09:38:52 +0200
commite4af8559784e851047702045ff677c9a91897fdd (patch)
tree36cb8b81a521f653ed17703639682de24ce6405f /rust/src/web.rs
parent67502b58c733b755f658f526aff0536828cd7757 (diff)
downloadlambda-nantes-e4af8559784e851047702045ff677c9a91897fdd.tar.gz
[wip] client generates applications with more than 2 terms
Diffstat (limited to 'rust/src/web.rs')
-rw-r--r--rust/src/web.rs24
1 files changed, 24 insertions, 0 deletions
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
@@ -465,6 +465,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();
let expected = "1".to_string();