Fix errors in test_hashset().
All tests now pass.
This commit is contained in:
parent
7d43b12c32
commit
37bea2a7d0
1 changed files with 4 additions and 3 deletions
|
@ -178,6 +178,7 @@ impl<A:ToStr> ToStr for @[A] {
|
||||||
#[allow(non_implicitly_copyable_typarams)]
|
#[allow(non_implicitly_copyable_typarams)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use hashmap::HashMap;
|
use hashmap::HashMap;
|
||||||
|
use hashmap::HashSet;
|
||||||
#[test]
|
#[test]
|
||||||
fn test_simple_types() {
|
fn test_simple_types() {
|
||||||
assert!(1i.to_str() == ~"1");
|
assert!(1i.to_str() == ~"1");
|
||||||
|
@ -224,8 +225,8 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_hashset() {
|
fn test_hashset() {
|
||||||
let mut set: HashSet<int, int> = HashSet::new();
|
let mut set: HashSet<int> = HashSet::new();
|
||||||
let empty_set: HashSet<int, int> = HashSet::new();
|
let empty_set: HashSet<int> = HashSet::new();
|
||||||
|
|
||||||
set.insert(1);
|
set.insert(1);
|
||||||
set.insert(2);
|
set.insert(2);
|
||||||
|
@ -233,6 +234,6 @@ mod tests {
|
||||||
let set_str = set.to_str();
|
let set_str = set.to_str();
|
||||||
|
|
||||||
assert!(set_str == ~"{1, 2}" || set_str == ~"{2, 1}");
|
assert!(set_str == ~"{1, 2}" || set_str == ~"{2, 1}");
|
||||||
assert!(empty.to_str() == ~"{}");
|
assert!(empty_set.to_str() == ~"{}");
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue