MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_token_hash_value

Function test_token_hash_value

atomic-core/src/diff/token/tests.rs:101–110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99
100 #[test]
101 fn test_token_hash_value() {
102 let t1 = Token::new(b"hello", TokenKind::Word, 0);
103 let t2 = Token::new(b"hello", TokenKind::Word, 10);
104 let t3 = Token::new(b"world", TokenKind::Word, 0);
105
106 // Same content = same hash
107 assert_eq!(t1.hash_value(), t2.hash_value());
108 // Different content = different hash (with high probability)
109 assert_ne!(t1.hash_value(), t3.hash_value());
110 }
111
112 #[test]
113 fn test_token_is_significant() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected