aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.rs6
-rw-r--r--tests/variables.tdy17
2 files changed, 23 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 53e2e08..c60dea1 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -40,4 +40,10 @@ mod tests {
let file = Path::new("tests/order-of-operations.tdy");
assert!(run_file(&file).is_ok());
}
+
+ #[test]
+ fn variables() {
+ let file = Path::new("tests/variables.tdy");
+ assert!(run_file(&file).is_ok());
+ }
}
diff --git a/tests/variables.tdy b/tests/variables.tdy
new file mode 100644
index 0000000..62b30d2
--- /dev/null
+++ b/tests/variables.tdy
@@ -0,0 +1,17 @@
+// a variable
+a int := 1
+a <=> 1
+
+// another variable
+b int := 2
+b <=> 2
+
+// assignment
+a = b
+a <=> 2
+
+// ordering
+c int := 3
+d int := 4
+c <=> 3
+d <=> 4