diff options
author | Florian Klink <flokli@flokli.de> | 2023-02-01T10·45+0100 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-02-01T16·31+0000 |
commit | f5ccb65f26b18e576d1eb50e4a981230adb9101d (patch) | |
tree | 40c3918fe54fdf0ef2c4b98d3c814c8b3c11767e /tvix/nix-compat/src/derivation/tests/mod.rs | |
parent | 964367044ddd85f3632af7c080dafb5abc49a221 (diff) |
feat(tvix/nix-compat/derivation): Display -> to_aterm_string() r/5809
Instead of implementing `std::fmt::Display for Derivation` and relying on the `to_string` method, introduce a `to_aterm_string()` method, which does the same thing, but makes it clearer what we're producing, rather than just calling `to_string()``. Change-Id: I21823de9096a0f2c2eb6f4591e48c1aa9fd94161 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7998 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
Diffstat (limited to '')
-rw-r--r-- | tvix/nix-compat/src/derivation/tests/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tvix/nix-compat/src/derivation/tests/mod.rs b/tvix/nix-compat/src/derivation/tests/mod.rs index 57c08f5a75f3..7b0ef6c3d961 100644 --- a/tvix/nix-compat/src/derivation/tests/mod.rs +++ b/tvix/nix-compat/src/derivation/tests/mod.rs @@ -44,13 +44,13 @@ fn validate(path_to_drv_file: &str) { } #[test_resources("src/derivation/tests/derivation_tests/*.drv")] -fn check_to_string(path_to_drv_file: &str) { +fn check_to_aterm_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"); let expected = read_file(path_to_drv_file); - assert_eq!(expected, derivation.to_string()); + assert_eq!(expected, derivation.to_aterm_string()); } #[test_case("bar","0hm2f1psjpcwg8fijsmr4wwxrx59s092-bar.drv"; "fixed_sha256")] |