From 3935c34401799bd8f782a0ead23859d38a011b42 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sat, 17 Sep 2022 13:50:58 -0400 Subject: test(tvix/eval): Add proptests covering trait impls for String Add a suite of proptests covering the laws of the handwritten stdlib trait impls (Eq, Ord, and Hash) for String, generated from a new set of macros for generating those tests which can be applied to other types. Change-Id: Ib3276c9e96fca497aece094e5612707d3dc77ccd Reviewed-on: https://cl.tvl.fyi/c/depot/+/6626 Autosubmit: grfn Reviewed-by: sterni Tested-by: BuildkiteCI --- tvix/eval/src/value/string.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tvix/eval/src/value') diff --git a/tvix/eval/src/value/string.rs b/tvix/eval/src/value/string.rs index 2056465343..bfbaa815db 100644 --- a/tvix/eval/src/value/string.rs +++ b/tvix/eval/src/value/string.rs @@ -177,3 +177,14 @@ impl Display for NixString { f.write_str("\"") } } + +#[cfg(test)] +mod tests { + use super::*; + + use crate::properties::{eq_laws, hash_laws, ord_laws}; + + eq_laws!(NixString); + hash_laws!(NixString); + ord_laws!(NixString); +} -- cgit 1.4.1