about summary refs log tree commit diff
path: root/tvix/eval/src/tests
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2023-02-13T07·54+0300
committerclbot <clbot@tvl.fyi>2023-02-13T16·21+0000
commitc98c5399b9ce7729a48e5ab5a1e389f31917aeb7 (patch)
treea48f57f850d9dfcca66fd27b7d01559595b22443 /tvix/eval/src/tests
parent91a366af465aad00141df82200530ccf5da11339 (diff)
fix(tvix/eval): skip runtime completely on compiler errors r/5848
This branch was missing, and an assumption elsewhere just executed the
returned (broken) bytecode.

This fixes b/253.

Change-Id: I015023ba921bc08ea03882167f1f560feca25e50
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8090
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval/src/tests')
-rw-r--r--tvix/eval/src/tests/one_offs.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tvix/eval/src/tests/one_offs.rs b/tvix/eval/src/tests/one_offs.rs
index 13b87267a987..23bc9465d6bb 100644
--- a/tvix/eval/src/tests/one_offs.rs
+++ b/tvix/eval/src/tests/one_offs.rs
@@ -22,3 +22,15 @@ fn test_source_builtin() {
         value,
     );
 }
+
+#[test]
+fn skip_broken_bytecode() {
+    let result = Evaluation::new(/* code = */ "x", None).evaluate();
+
+    assert_eq!(result.errors.len(), 1);
+
+    assert!(matches!(
+        result.errors[0].kind,
+        ErrorKind::UnknownStaticVariable
+    ));
+}