diff options
| author | nham <hamann.nick@gmail.com> | 2014-07-25 21:35:58 -0400 |
|---|---|---|
| committer | nham <hamann.nick@gmail.com> | 2014-07-26 12:06:52 -0400 |
| commit | 3f1c37e96da571e6eb8137aad1b5d65ea3f89a0b (patch) | |
| tree | 7716ab9ae9eb6a92904064795e4cb70995e7e400 /src/libcollections | |
| parent | 1e997d62b7dc91779ace53cf18e31bc955a334f0 (diff) | |
| download | rust-3f1c37e96da571e6eb8137aad1b5d65ea3f89a0b.tar.gz rust-3f1c37e96da571e6eb8137aad1b5d65ea3f89a0b.zip | |
Small fixes for tests
Diffstat (limited to 'src/libcollections')
| -rw-r--r-- | src/libcollections/smallintmap.rs | 14 | ||||
| -rw-r--r-- | src/libcollections/trie.rs | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/libcollections/smallintmap.rs b/src/libcollections/smallintmap.rs index 94aae9b0085..56fb7e3632e 100644 --- a/src/libcollections/smallintmap.rs +++ b/src/libcollections/smallintmap.rs @@ -24,7 +24,6 @@ use core::mem::replace; use {Collection, Mutable, Map, MutableMap, MutableSeq}; use {vec, slice}; use vec::Vec; -use hash::Hash; /// A map optimized for small integer keys. /// @@ -59,7 +58,7 @@ use hash::Hash; /// months.clear(); /// assert!(months.is_empty()); /// ``` -#[deriving(PartialEq, Eq, Hash)] +#[deriving(Hash, PartialEq, Eq)] pub struct SmallIntMap<T> { v: Vec<Option<T>>, } @@ -480,8 +479,9 @@ pub type Values<'a, T> = mod test_map { use std::prelude::*; use std::hash; + use vec::Vec; - use {Map, MutableMap, Mutable}; + use {Map, MutableMap, Mutable, MutableSeq}; use super::SmallIntMap; #[test] @@ -737,9 +737,9 @@ mod test_map { fn test_clone() { let mut a = SmallIntMap::new(); - a.insert(1, vec!(4i, 5, 6)); - a.insert(4, vec!()); - a.insert(6, vec!(1, 3)); + a.insert(1, 'x'); + a.insert(4, 'y'); + a.insert(6, 'z'); assert!(a.clone() == a); } @@ -781,7 +781,7 @@ mod test_map { #[test] fn test_from_iter() { - let xs = vec![(1u, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e'), (6, 'f')]; + let xs: Vec<(uint, char)> = vec![(1u, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e')]; let map: SmallIntMap<char> = xs.iter().map(|&x| x).collect(); diff --git a/src/libcollections/trie.rs b/src/libcollections/trie.rs index 1fe8747dfa8..1ac05fbd562 100644 --- a/src/libcollections/trie.rs +++ b/src/libcollections/trie.rs @@ -1329,7 +1329,7 @@ mod test_map { #[test] fn test_show() { let mut map = TrieMap::new(); - let empty = TrieMap::new(); + let empty: TrieMap<uint> = TrieMap::new(); map.insert(1, 'a'); map.insert(2, 'b'); |
