about summary refs log tree commit diff
path: root/tvix/serde/src/de_tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/serde/src/de_tests.rs')
-rw-r--r--tvix/serde/src/de_tests.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/tvix/serde/src/de_tests.rs b/tvix/serde/src/de_tests.rs
index 8fe15a17e378..50a078cc0998 100644
--- a/tvix/serde/src/de_tests.rs
+++ b/tvix/serde/src/de_tests.rs
@@ -1,7 +1,7 @@
 use serde::Deserialize;
 use std::collections::HashMap;
 
-use crate::de::from_str;
+use crate::de::{from_str, from_str_with_config};
 
 #[test]
 fn deserialize_none() {
@@ -198,3 +198,14 @@ fn deserialize_enum_all() {
 
     assert_eq!(result, expected);
 }
+
+#[test]
+fn deserialize_with_config() {
+    let result: String = from_str_with_config("builtins.testWithConfig", |eval| {
+        // Add a literal string builtin that just returns `"ok"`.
+        eval.src_builtins.push(("testWithConfig", "\"ok\""));
+    })
+    .expect("should deserialize");
+
+    assert_eq!(result, "ok");
+}