diff options
Diffstat (limited to 'tvix/derivation/src/tests/mod.rs')
-rw-r--r-- | tvix/derivation/src/tests/mod.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tvix/derivation/src/tests/mod.rs b/tvix/derivation/src/tests/mod.rs index 435d82144067..1b55c6e3e751 100644 --- a/tvix/derivation/src/tests/mod.rs +++ b/tvix/derivation/src/tests/mod.rs @@ -31,6 +31,16 @@ fn check_serizaliation(path_to_drv_file: &str) { } #[test_resources("src/tests/derivation_tests/*.drv")] +fn validate(path_to_drv_file: &str) { + let data = read_file(&format!("{}.json", path_to_drv_file)); + let derivation: Derivation = serde_json::from_str(&data).expect("JSON was not well-formatted"); + + derivation + .validate() + .expect("derivation failed to validate") +} + +#[test_resources("src/tests/derivation_tests/*.drv")] fn check_to_string(path_to_drv_file: &str) { let data = read_file(&format!("{}.json", path_to_drv_file)); let derivation: Derivation = serde_json::from_str(&data).expect("JSON was not well-formatted"); |