aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/main.rs b/src/main.rs
index c60dea1..dc4b14c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -35,15 +35,16 @@ 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());
+ macro_rules! test_file {
+ ($fn:ident, $path:literal) => {
+ #[test]
+ fn $fn() {
+ let file = Path::new($path);
+ assert!(run_file(&file).is_ok());
+ }
+ };
}
- #[test]
- fn variables() {
- let file = Path::new("tests/variables.tdy");
- assert!(run_file(&file).is_ok());
- }
+ test_file!(order_of_operations, "tests/order-of-operations.tdy");
+ test_file!(variables, "tests/variables.tdy");
}