From 778b143e45838e89df954d77226267f041c99642 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 26 Nov 2015 00:27:20 +0100 Subject: [PATCH] More tests. --- src/hash.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hash.rs b/src/hash.rs index 94d2af62f..224bc3699 100644 --- a/src/hash.rs +++ b/src/hash.rs @@ -59,5 +59,11 @@ impl_hash!(Hash4096, 512); #[test] fn it_works() { - assert_eq!(Hash64::from_str("0123456789abcdef").unwrap(), Hash64([0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef])); + let h = Hash64([0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef]); + assert_eq!(Hash64::from_str("0123456789abcdef").unwrap(), h); + assert_eq!(format!("{}", h), "0123456789abcdef"); + assert_eq!(format!("{:?}", h), "0123456789abcdef"); + assert!(h == h); + assert!(h != Hash64([0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xee])); + assert!(h != Hash64([0; 8])); } \ No newline at end of file