From 42b6130e649b41671620134ed73fa2ae7b0990a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edvard=20Th=C3=B6rnros?= Date: Mon, 15 Feb 2021 22:36:32 +0100 Subject: add more tests --- src/lib.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 7253141..907a1cd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -833,6 +833,12 @@ mod tests { assert_errs!(run_string("a :: 2\nq :: fn { a = 2 }\n", true, Vec::new()), [ErrorKind::SyntaxError(_, _)]); } + #[test] + fn undefined_blob() { + assert_errs!(run_string("a :: B()\n", true, Vec::new()), [ErrorKind::SyntaxError(_, _)]); + } + + macro_rules! test_multiple { ($mod:ident, $( $fn:ident : $prog:literal ),+ $( , )? ) => { mod $mod { @@ -1183,6 +1189,7 @@ a := 0 a <=> -1 ", ); + test_multiple!( declaration_order, simple: " @@ -1193,5 +1200,15 @@ blob A { } ", + complex: " +a := A() +b := B() +c := C() +b2 := B() + +blob A { } +blob C { } +blob B { } +", ); } -- cgit v1.2.1