From 10aa849d28d74c2c332f24a0da55833c95d91ab1 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 10 Sep 2012 15:35:37 -0700 Subject: [PATCH] Fix broken tests --- src/test/bench/shootout-k-nucleotide-pipes.rs | 7 ++++--- src/test/bench/shootout-k-nucleotide.rs | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs index 5437de9643a..69e84286f23 100644 --- a/src/test/bench/shootout-k-nucleotide-pipes.rs +++ b/src/test/bench/shootout-k-nucleotide-pipes.rs @@ -8,6 +8,7 @@ use std::map::hashmap; use std::sort; use io::ReaderUtil; use pipes::{stream, Port, Chan}; +use cmp::Ord; // given a map, print a sorted version of it fn sort_and_fmt(mm: hashmap<~[u8], uint>, total: uint) -> ~str { @@ -15,14 +16,14 @@ fn sort_and_fmt(mm: hashmap<~[u8], uint>, total: uint) -> ~str { return (xx as float) * 100f / (yy as float); } - pure fn le_by_val(kv0: &(TT,UU), + pure fn le_by_val(kv0: &(TT,UU), kv1: &(TT,UU)) -> bool { let (_, v0) = *kv0; let (_, v1) = *kv1; return v0 >= v1; } - pure fn le_by_key(kv0: &(TT,UU), + pure fn le_by_key(kv0: &(TT,UU), kv1: &(TT,UU)) -> bool { let (k0, _) = *kv0; let (k1, _) = *kv1; @@ -30,7 +31,7 @@ fn sort_and_fmt(mm: hashmap<~[u8], uint>, total: uint) -> ~str { } // sort by key, then by value - fn sortKV(orig: ~[(TT,UU)]) -> ~[(TT,UU)] { + fn sortKV(orig: ~[(TT,UU)]) -> ~[(TT,UU)] { return sort::merge_sort(le_by_val, sort::merge_sort(le_by_key, orig)); } diff --git a/src/test/bench/shootout-k-nucleotide.rs b/src/test/bench/shootout-k-nucleotide.rs index c1d9a10a106..d5f9860caa1 100644 --- a/src/test/bench/shootout-k-nucleotide.rs +++ b/src/test/bench/shootout-k-nucleotide.rs @@ -7,6 +7,7 @@ use std::map; use std::map::hashmap; use std::sort; use io::ReaderUtil; +use cmp::Ord; // given a map, print a sorted version of it fn sort_and_fmt(mm: hashmap<~[u8], uint>, total: uint) -> ~str {