Skip to content

Commit

Permalink
Fix errors in test_hashset().
Browse files Browse the repository at this point in the history
All tests now pass.
  • Loading branch information
samebchase committed May 11, 2013
1 parent 7d43b12 commit 37bea2a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/libcore/to_str.rs
Expand Up @@ -178,6 +178,7 @@ impl<A:ToStr> ToStr for @[A] {
#[allow(non_implicitly_copyable_typarams)]
mod tests {
use hashmap::HashMap;
use hashmap::HashSet;
#[test]
fn test_simple_types() {
assert!(1i.to_str() == ~"1");
Expand Down Expand Up @@ -224,15 +225,15 @@ mod tests {

#[test]
fn test_hashset() {
let mut set: HashSet<int, int> = HashSet::new();
let empty_set: HashSet<int, int> = HashSet::new();
let mut set: HashSet<int> = HashSet::new();
let empty_set: HashSet<int> = HashSet::new();

set.insert(1);
set.insert(2);

let set_str = set.to_str();

assert!(set_str == ~"{1, 2}" || set_str == ~"{2, 1}");
assert!(empty.to_str() == ~"{}");
assert!(empty_set.to_str() == ~"{}");
}
}

4 comments on commit 37bea2a

@bors
Copy link
Contributor

@bors bors commented on 37bea2a May 12, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 37bea2a May 12, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging samebchase/rust/experimental = 37bea2a into auto

@bors
Copy link
Contributor

@bors bors commented on 37bea2a May 12, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

samebchase/rust/experimental = 37bea2a merged ok, testing candidate = 1c08b298

@bors
Copy link
Contributor

@bors bors commented on 37bea2a May 12, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.