You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #79 we've entroduced for_each_type! macro allowing us to iterate through different types of ResourceId implementations and use the corresponding hash function.
Now, we could define two broad categories of "cryptographic" and "fast" hash functions another macro wrappers, so we can simply add new functions into one of the two categories, and the test cases will work with new functions automatically without necessity to update them manually.
This will allow us to describe invariants in generic terms, not specific functions:
fn test_no_collisions_with_cryptographic_hashing() {
for_cryptographic_hashing! {
// setup a folder without duplicates
// index it
assert_eq!(index.collisions, 0);
}
}
On the other hand, we are still free to create custom test cases for one or two specific functions, these test cases will not be run excessively for functions that are not involved
fn test_no_collisions_with_cryptographic_hashing() {
for_each_hashing!(take_first_byte, take_last_byte) {
// setup a folder without duplicates
// index it
assert_eq!(index.keys.size(), 8); //synthetic example
}
}
The text was updated successfully, but these errors were encountered:
In #79 we've entroduced
for_each_type!
macro allowing us to iterate through different types ofResourceId
implementations and use the corresponding hash function.Now, we could define two broad categories of "cryptographic" and "fast" hash functions another macro wrappers, so we can simply add new functions into one of the two categories, and the test cases will work with new functions automatically without necessity to update them manually.
This will allow us to describe invariants in generic terms, not specific functions:
On the other hand, we are still free to create custom test cases for one or two specific functions, these test cases will not be run excessively for functions that are not involved
The text was updated successfully, but these errors were encountered: