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

Function test_token_hash_trait

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

Source from the content-addressed store, hash-verified

136
137 #[test]
138 fn test_token_hash_trait() {
139 use std::collections::HashSet;
140
141 let t1 = Token::new(b"hello", TokenKind::Word, 0);
142 let t2 = Token::new(b"hello", TokenKind::Word, 10);
143 let t3 = Token::new(b"world", TokenKind::Word, 0);
144
145 let mut set = HashSet::new();
146 set.insert(t1.clone());
147 set.insert(t2);
148 set.insert(t3);
149
150 // t1 and t2 should hash the same, so only 2 items
151 assert_eq!(set.len(), 2);
152 }
153
154 #[test]
155 fn test_token_debug() {

Callers

nothing calls this directly

Calls 2

insertMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected