about summary refs log tree commit diff
path: root/tvix
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2022-09-18T17·22-0400
committerclbot <clbot@tvl.fyi>2022-09-18T17·57+0000
commitc7faba0c8ee0eea6b20540569ecbd99eb76fedfa (patch)
tree1fa389f6e113f684155b8211a85a363a3960d649 /tvix
parent96d869923a13eab14d2bb111500a59f775967d9a (diff)
test(tvix/eval): Add tests for the Eq laws of Value r/4905
Only running 20 cases for now, since Value can get quite big if you let
it run for a while.

Change-Id: I09ef19da22c789c4869793836c98937c44595340
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6648
Autosubmit: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix')
-rw-r--r--tvix/eval/proptest-regressions/value/mod.txt7
-rw-r--r--tvix/eval/src/value/mod.rs16
2 files changed, 23 insertions, 0 deletions
diff --git a/tvix/eval/proptest-regressions/value/mod.txt b/tvix/eval/proptest-regressions/value/mod.txt
new file mode 100644
index 0000000000..6817f771f0
--- /dev/null
+++ b/tvix/eval/proptest-regressions/value/mod.txt
@@ -0,0 +1,7 @@
+# Seeds for failure cases proptest has generated in the past. It is
+# automatically read and these particular cases re-run before any
+# novel cases are generated.
+#
+# It is recommended to check this file in to source control so that
+# everyone who runs the test benefits from these saved cases.
+cc 241ec68db9f684f4280d4c7907f7105e7b746df433fbb5cbd6bf45323a7f3be0 # shrinks to input = _ReflexiveArgs { x: List(NixList([List(NixList([Path("𑁯")]))])) }
diff --git a/tvix/eval/src/value/mod.rs b/tvix/eval/src/value/mod.rs
index 85abbcd3ee..594c1fd473 100644
--- a/tvix/eval/src/value/mod.rs
+++ b/tvix/eval/src/value/mod.rs
@@ -332,3 +332,19 @@ fn type_error(expected: &'static str, actual: &Value) -> ErrorKind {
         actual: actual.type_of(),
     }
 }
+
+#[cfg(test)]
+mod tests {
+    use crate::properties::eq_laws;
+    use proptest::prelude::ProptestConfig;
+
+    use super::*;
+
+    eq_laws!(
+        Value,
+        ProptestConfig {
+            cases: 20,
+            ..Default::default()
+        }
+    );
+}