mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Fix test bustage in util::cache.
This commit is contained in:
parent
631ab7d3e2
commit
eacf27263e
1 changed files with 6 additions and 6 deletions
|
@ -49,11 +49,11 @@ fn test_monocache() {
|
||||||
let cache = cache::new::<uint, @str, MonoCache<uint, @str>>(10);
|
let cache = cache::new::<uint, @str, MonoCache<uint, @str>>(10);
|
||||||
let one = @"one";
|
let one = @"one";
|
||||||
let two = @"two";
|
let two = @"two";
|
||||||
cache.insert(1, one);
|
cache.insert(&1, one);
|
||||||
|
|
||||||
assert cache.find(1).is_some();
|
assert cache.find(&1).is_some();
|
||||||
assert cache.find(2).is_none();
|
assert cache.find(&2).is_none();
|
||||||
cache.find_or_create(2, |_v| { two });
|
cache.find_or_create(&2, |_v| { two });
|
||||||
assert cache.find(2).is_some();
|
assert cache.find(&2).is_some();
|
||||||
assert cache.find(1).is_none();
|
assert cache.find(&1).is_none();
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue