about summary refs log tree commit diff
path: root/tvix/eval/src/value/list.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/value/list.rs')
-rw-r--r--tvix/eval/src/value/list.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tvix/eval/src/value/list.rs b/tvix/eval/src/value/list.rs
index c00ddd4191ea..19415c0d557f 100644
--- a/tvix/eval/src/value/list.rs
+++ b/tvix/eval/src/value/list.rs
@@ -20,6 +20,25 @@ impl Display for NixList {
     }
 }
 
+#[cfg(feature = "arbitrary")]
+mod arbitrary {
+    use proptest::{
+        prelude::{any_with, Arbitrary},
+        strategy::{BoxedStrategy, Strategy},
+    };
+
+    use super::*;
+
+    impl Arbitrary for NixList {
+        type Parameters = <Vec<Value> as Arbitrary>::Parameters;
+        type Strategy = BoxedStrategy<Self>;
+
+        fn arbitrary_with(args: Self::Parameters) -> Self::Strategy {
+            any_with::<Vec<Value>>(args).prop_map(Self).boxed()
+        }
+    }
+}
+
 impl NixList {
     pub fn concat(&self, other: &Self) -> Self {
         let mut lhs = self.clone();