about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2021-03-14T20·43-0400
committerGriffin Smith <root@gws.fyi>2021-03-14T20·43-0400
commitecb4c0f803e9b408e4fd21c475769eb4dc649d14 (patch)
tree80390b00a6009cea21fbb68cbf56e6a193b478a2 /tests
parent7960c3270e1a338f4da40d044a6896df96d82c79 (diff)
Universally quantified type variables
Implement universally quantified type variables, both explicitly given
by the user and inferred by the type inference algorithm.
Diffstat (limited to 'tests')
-rw-r--r--tests/compile.rs41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/compile.rs b/tests/compile.rs
new file mode 100644
index 000000000000..177391423c7d
--- /dev/null
+++ b/tests/compile.rs
@@ -0,0 +1,41 @@
+use std::process::Command;
+
+use crate_root::root;
+
+const FIXTURES: &[(&str, i32)] = &[("simple", 5), ("functions", 9)];
+
+#[test]
+fn compile_and_run_files() {
+    let ach = root().unwrap().join("ach");
+
+    for (fixture, exit_code) in FIXTURES {
+        println!(">>> Testing: {}", fixture);
+
+        println!("    Running: `make {}`", fixture);
+        assert!(
+            Command::new("make")
+                .arg(fixture)
+                .current_dir(&ach)
+                .spawn()
+                .unwrap()
+                .wait()
+                .unwrap()
+                .success(),
+            "make failed"
+        );
+
+        let out_path = ach.join(fixture);
+        println!("    Running: `{}`", out_path.to_str().unwrap());
+        assert_eq!(
+            Command::new(out_path)
+                .spawn()
+                .unwrap()
+                .wait()
+                .unwrap()
+                .code()
+                .unwrap(),
+            *exit_code,
+        );
+        println!("    OK");
+    }
+}