From 879865002485c6f9345a7e450bd778d102a13f62 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Mon, 1 Nov 2021 15:56:20 -0700 Subject: [PATCH] Additional record pattern test --- schala-lang/language/src/tree_walk_eval/test.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/schala-lang/language/src/tree_walk_eval/test.rs b/schala-lang/language/src/tree_walk_eval/test.rs index b710668..069b0aa 100644 --- a/schala-lang/language/src/tree_walk_eval/test.rs +++ b/schala-lang/language/src/tree_walk_eval/test.rs @@ -193,6 +193,16 @@ if alpha { is _ then ("nooo", 8888) }"#; eval_assert(source, r#"("sanchez", 20)"#); + + let source = r#" +type Vstsavlobs = { tkveni: Int, b: Ia } +type Ia = { sitqva: Int, ghmerts: String } +let b = Vstsavlobs::Vstsavlobs { tkveni: 3, b: Ia::Ia { sitqva: 5, ghmerts: "ooo" } } +if b { + is Vstsavlobs::Vstsavlobs { tkveni: _, b: Ia::Ia { sitqva, ghmerts } } then sitqva + is _ then 5000 +}"#; + eval_assert(source, "5"); } #[test]