MCPcopy Create free account
hub / github.com/carsonpo/haystackdb / test_hamming_distance

Function test_hamming_distance

tests/math.rs:15–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13 // Test the basic functionality of the hamming_distance function
14 #[test]
15 fn test_hamming_distance() {
16 let a: [u8; QUANTIZED_VECTOR_SIZE] = [0xFF; QUANTIZED_VECTOR_SIZE]; // All bits set
17 let b: [u8; QUANTIZED_VECTOR_SIZE] = [0x00; QUANTIZED_VECTOR_SIZE]; // All bits unset
18 assert_eq!(hamming_distance(&a, &b), QUANTIZED_VECTOR_SIZE as u16 * 8);
19 }
20
21 // Test the zero case for hamming_distance
22 #[test]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected