Skip to content

Commit ce1a10d

Browse files
committed
Change 'print(fmt!(...))' to printf!/printfln! in src/test/
1 parent 19c8c7a commit ce1a10d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+99
-103
lines changed

src/test/bench/core-map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn timed(label: &str, f: &fn()) {
2424
let start = time::precise_time_s();
2525
f();
2626
let end = time::precise_time_s();
27-
io::println(fmt!(" %s: %f", label, end - start));
27+
printfln!(" %s: %f", label, end - start);
2828
}
2929

3030
fn ascending<M: MutableMap<uint, uint>>(map: &mut M, n_keys: uint) {
@@ -116,7 +116,7 @@ fn main() {
116116
}
117117
}
118118

119-
io::println(fmt!("%? keys", n_keys));
119+
printfln!("%? keys", n_keys);
120120

121121
io::println("\nTreeMap:");
122122

src/test/bench/core-std.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ fn maybe_run_test(argv: &[~str], name: ~str, test: &fn()) {
5858
test();
5959
let stop = precise_time_s();
6060

61-
io::println(fmt!("%s:\t\t%f ms", name, (stop - start) * 1000f));
61+
printfln!("%s:\t\t%f ms", name, (stop - start) * 1000f);
6262
}
6363

6464
fn shift_push() {

src/test/bench/msgsend-ring-mutex-arcs.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ fn main() {
119119
let elapsed = (stop - start);
120120
let rate = (num_msgs as float) / elapsed;
121121

122-
io::println(fmt!("Sent %? messages in %? seconds",
123-
num_msgs, elapsed));
124-
io::println(fmt!(" %? messages / second", rate));
125-
io::println(fmt!(" %? μs / message", 1000000. / rate));
122+
printfln!("Sent %? messages in %? seconds", num_msgs, elapsed);
123+
printfln!(" %? messages / second", rate);
124+
printfln!(" %? μs / message", 1000000. / rate);
126125
}

src/test/bench/msgsend-ring-pipes.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ fn main() {
105105
let elapsed = (stop - start);
106106
let rate = (num_msgs as float) / elapsed;
107107

108-
io::println(fmt!("Sent %? messages in %? seconds",
109-
num_msgs, elapsed));
110-
io::println(fmt!(" %? messages / second", rate));
111-
io::println(fmt!(" %? μs / message", 1000000. / rate));
108+
printfln!("Sent %? messages in %? seconds", num_msgs, elapsed);
109+
printfln!(" %? messages / second", rate);
110+
printfln!(" %? μs / message", 1000000. / rate);
112111
}

src/test/bench/msgsend-ring-rw-arcs.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ fn main() {
115115
let elapsed = (stop - start);
116116
let rate = (num_msgs as float) / elapsed;
117117

118-
io::println(fmt!("Sent %? messages in %? seconds",
119-
num_msgs, elapsed));
120-
io::println(fmt!(" %? messages / second", rate));
121-
io::println(fmt!(" %? μs / message", 1000000. / rate));
118+
printfln!("Sent %? messages in %? seconds", num_msgs, elapsed);
119+
printfln!(" %? messages / second", rate);
120+
printfln!(" %? μs / message", 1000000. / rate);
122121
}

src/test/bench/pingpong.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,13 @@ fn main() {
198198
let bounded = do timeit { bounded(count) };
199199
let unbounded = do timeit { unbounded(count) };
200200

201-
io::println(fmt!("count: %?\n", count));
202-
io::println(fmt!("bounded: %? s\t(%? μs/message)",
203-
bounded, bounded * 1000000. / (count as float)));
204-
io::println(fmt!("unbounded: %? s\t(%? μs/message)",
205-
unbounded, unbounded * 1000000. / (count as float)));
206-
207-
io::println(fmt!("\n\
208-
bounded is %?%% faster",
209-
(unbounded - bounded) / bounded * 100.));
201+
printfln!("count: %?\n", count);
202+
printfln!("bounded: %? s\t(%? μs/message)",
203+
bounded, bounded * 1000000. / (count as float));
204+
printfln!("unbounded: %? s\t(%? μs/message)",
205+
unbounded, unbounded * 1000000. / (count as float));
206+
207+
printfln!("\n\
208+
bounded is %?%% faster",
209+
(unbounded - bounded) / bounded * 100.);
210210
}

src/test/bench/shootout-ackermann.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ fn main() {
3636
args
3737
};
3838
let n = int::from_str(args[1]).get();
39-
io::println(fmt!("Ack(3,%d): %d\n", n, ack(3, n)));
39+
printfln!("Ack(3,%d): %d\n", n, ack(3, n));
4040
}

src/test/bench/shootout-binarytrees.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ fn main() {
6161
let stretch_depth = max_depth + 1;
6262
let stretch_tree = bottom_up_tree(&stretch_arena, 0, stretch_depth);
6363

64-
println(fmt!("stretch tree of depth %d\t check: %d",
65-
stretch_depth,
66-
item_check(stretch_tree)));
64+
printfln!("stretch tree of depth %d\t check: %d",
65+
stretch_depth,
66+
item_check(stretch_tree));
6767

6868
let long_lived_arena = arena::Arena();
6969
let long_lived_tree = bottom_up_tree(&long_lived_arena, 0, max_depth);
@@ -79,12 +79,11 @@ fn main() {
7979
chk += item_check(temp_tree);
8080
i += 1;
8181
}
82-
println(fmt!("%d\t trees of depth %d\t check: %d",
83-
iterations * 2, depth,
84-
chk));
82+
printfln!("%d\t trees of depth %d\t check: %d",
83+
iterations * 2, depth, chk));
8584
depth += 2;
8685
}
87-
println(fmt!("long lived tree of depth %d\t check: %d",
88-
max_depth,
89-
item_check(long_lived_tree)));
86+
printfln!("long lived tree of depth %d\t check: %d",
87+
max_depth,
88+
item_check(long_lived_tree));
9089
}

src/test/bench/shootout-fannkuch-redux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,5 @@ fn fannkuch_redux(n: i32) -> i32 {
9393
#[fixed_stack_segment]
9494
fn main() {
9595
let n: i32 = FromStr::from_str(os::args()[1]).get();
96-
println(fmt!("Pfannkuchen(%d) = %d", n as int, fannkuch_redux(n) as int));
96+
printfln!("Pfannkuchen(%d) = %d", n as int, fannkuch_redux(n) as int);
9797
}

src/test/bench/shootout-fibo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ fn main() {
3232
args
3333
};
3434
let n = int::from_str(args[1]).get();
35-
io::println(fmt!("%d\n", fib(n)));
35+
printfln!("%d\n", fib(n));
3636
}

0 commit comments

Comments
 (0)