//! # vanify::utils::hex tests use vanify::utils::hex; // Trim hex output should not contain "0x" prefix #[test] fn test_trim_hex() { let hex = "0x1234567890abcdef".to_string(); assert_eq!(hex::trim_hex(&hex), "1234567890abcdef".to_string()); } // Format hex output should contain "0x" prefix #[test] fn test_fmt_hex() { let hex = "1234567890abcdef".to_string(); assert_eq!(hex::fmt_hex(&hex), "0x1234567890abcdef".to_string()); } // Is valid hex should return true for valid hex #[test] fn test_is_valid_hex() { let hex = "1234567890abcdef".to_string(); assert_eq!(hex::is_valid_hex(&hex), true); } // Is valid hex should return false for invalid hex #[test] fn test_is_valid_hex_invalid() { let hex = "1234567890abcdefg".to_string(); assert_eq!(hex::is_valid_hex(&hex), false); }