diff options
Diffstat (limited to 'src/libcore/tests')
| -rw-r--r-- | src/libcore/tests/hash/mod.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libcore/tests/hash/mod.rs b/src/libcore/tests/hash/mod.rs index 53ac17c052f..49e41f02428 100644 --- a/src/libcore/tests/hash/mod.rs +++ b/src/libcore/tests/hash/mod.rs @@ -109,3 +109,13 @@ fn test_custom_state() { assert_eq!(hash(&Custom { hash: 5 }), 5); } + +#[test] +fn test_indirect_hasher() { + let mut hasher = MyHasher { hash: 0 }; + { + let mut indirect_hasher: &mut Hasher = &mut hasher; + 5u32.hash(&mut indirect_hasher); + } + assert_eq!(hasher.hash, 5); +} |
