aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorEdvard Thörnros <edvard.thornros@gmail.com>2021-02-15 22:36:32 +0100
committerEdvard Thörnros <edvard.thornros@gmail.com>2021-02-15 22:36:32 +0100
commit42b6130e649b41671620134ed73fa2ae7b0990a1 (patch)
tree9c4ba1b86ed3372f0c99ce0d4e225cca7bfc87c9 /src/lib.rs
parent3c5a33f008b40e272d3a720aa81fb5a8568a4527 (diff)
downloadsylt-42b6130e649b41671620134ed73fa2ae7b0990a1.tar.gz
add more tests
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs17
1 files changed, 17 insertions, 0 deletions
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 { }
+",
);
}