aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-01-10 14:06:57 +0100
committerGustav Sörnäs <gustav@sornas.net>2021-01-10 14:06:57 +0100
commitd42c86f010abf52e3853760bbbadb888517d7afe (patch)
tree941c5c92e3e1425988d7c09e47c32317ed7e2530 /src/main.rs
parent78749296776b2d9b7cb1d03b93c97ceb32c8c0b3 (diff)
downloadsylt-d42c86f010abf52e3853760bbbadb888517d7afe.tar.gz
add test ooo
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index e6265f8..f599011 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -20,5 +20,15 @@ fn run_file(path: &Path) -> Result<(), vm::VMError> {
let block = compiler::compile("main", path, tokens); // path -> str might fail
vm::run_block(block)
}
+
+#[cfg(test)]
+mod tests {
+ use super::run_file;
+ use std::path::Path;
+
+ #[test]
+ fn order_of_operations() {
+ let file = Path::new("tests/order-of-operations.tdy");
+ assert!(run_file(&file).is_ok());
}
}