diff options
| author | Graydon Hoare <[email protected]> | 2010-08-24 17:23:09 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-08-24 17:23:09 -0700 |
| commit | e846643d23ab20ca7fc194e358053ebf0f74d47e (patch) | |
| tree | 54ff082ed5f446ff057524c92509edefb7fd35e7 /src/test/run-pass/lib-map.rs | |
| parent | Fix residual nonsense of storing crate-rel displacements in a closure pair (m... (diff) | |
| download | rust-e846643d23ab20ca7fc194e358053ebf0f74d47e.tar.xz rust-e846643d23ab20ca7fc194e358053ebf0f74d47e.zip | |
Fix mod-bug in std.map, work around bug in closure typaram capture, enable insert-tests in lib-map.rs.
Diffstat (limited to 'src/test/run-pass/lib-map.rs')
| -rw-r--r-- | src/test/run-pass/lib-map.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/test/run-pass/lib-map.rs b/src/test/run-pass/lib-map.rs index 058fb237..4f965789 100644 --- a/src/test/run-pass/lib-map.rs +++ b/src/test/run-pass/lib-map.rs @@ -7,11 +7,18 @@ fn test_simple() { log "*** starting test_simple"; fn eq(&uint x, &uint y) -> bool { ret x == y; } + fn hash(&uint u) -> uint { + // FIXME: can't use std.util.id since we'd be capturing a type param, + // and presently we can't close items over type params. + ret u; + } - let map.hashfn[uint] hasher = std.util.id[uint]; + let map.hashfn[uint] hasher = hash; let map.eqfn[uint] eqer = eq; let map.hashmap[uint, uint] hm = map.mk_hashmap[uint, uint](hasher, eqer); - + hm.insert(10u, 12u); + hm.insert(11u, 13u); + hm.insert(12u, 14u); log "*** finished test_simple"; } |