about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-05-27 20:44:58 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-05-28 08:35:41 -0700
commit42aed6bde2fb05a262e21334656cdf91f51744dd (patch)
tree0b7c43f70001fe714a13f95df7e2807a8fdfb85b /src/test
parent24b1ce1daf9dbf66d04116d0549a48a7610bc614 (diff)
downloadrust-42aed6bde2fb05a262e21334656cdf91f51744dd.tar.gz
rust-42aed6bde2fb05a262e21334656cdf91f51744dd.zip
std: Remove format_strbuf!()
This was only ever a transitionary macro.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/bench/shootout-binarytrees.rs4
-rw-r--r--src/test/bench/shootout-chameneos-redux.rs4
-rw-r--r--src/test/bench/shootout-k-nucleotide-pipes.rs10
-rw-r--r--src/test/compile-fail/issue-13428.rs4
-rw-r--r--src/test/run-fail/explicit-fail-msg.rs2
-rw-r--r--src/test/run-fail/unwind-lambda.rs4
-rw-r--r--src/test/run-pass/autoref-intermediate-types-issue-3585.rs4
-rw-r--r--src/test/run-pass/bug-7183-generics.rs6
-rw-r--r--src/test/run-pass/closure-reform.rs6
-rw-r--r--src/test/run-pass/issue-2804.rs2
-rw-r--r--src/test/run-pass/issue-8898.rs2
-rw-r--r--src/test/run-pass/log-knows-the-names-of-variants-in-std.rs6
-rw-r--r--src/test/run-pass/log-knows-the-names-of-variants.rs6
-rw-r--r--src/test/run-pass/match-borrowed_str.rs4
-rw-r--r--src/test/run-pass/monad.rs4
-rw-r--r--src/test/run-pass/process-spawn-with-unicode-params.rs3
-rw-r--r--src/test/run-pass/send_str_treemap.rs2
-rw-r--r--src/test/run-pass/str-concat.rs2
-rw-r--r--src/test/run-pass/string-self-append.rs2
-rw-r--r--src/test/run-pass/trait-cast.rs7
-rw-r--r--src/test/run-pass/trait-to-str.rs12
-rw-r--r--src/test/run-pass/traits-default-method-macro.rs2
22 files changed, 46 insertions, 52 deletions
diff --git a/src/test/bench/shootout-binarytrees.rs b/src/test/bench/shootout-binarytrees.rs
index db68edc73ba..1dc52166965 100644
--- a/src/test/bench/shootout-binarytrees.rs
+++ b/src/test/bench/shootout-binarytrees.rs
@@ -74,8 +74,8 @@ fn main() {
                     let b = bottom_up_tree(&arena, -i, depth);
                     chk += item_check(a) + item_check(b);
                 }
-                format_strbuf!("{}\t trees of depth {}\t check: {}",
-                               iterations * 2, depth, chk)
+                format!("{}\t trees of depth {}\t check: {}",
+                        iterations * 2, depth, chk)
             })
         }).collect::<Vec<Future<String>>>();
 
diff --git a/src/test/bench/shootout-chameneos-redux.rs b/src/test/bench/shootout-chameneos-redux.rs
index 2c8b23f2acd..baf02feb5b8 100644
--- a/src/test/bench/shootout-chameneos-redux.rs
+++ b/src/test/bench/shootout-chameneos-redux.rs
@@ -134,9 +134,7 @@ fn creature(
         }
     }
     // log creatures met and evil clones of self
-    let report = format_strbuf!("{}{}",
-                                creatures_met,
-                                Number(evil_clones_met));
+    let report = format!("{}{}", creatures_met, Number(evil_clones_met));
     to_rendezvous_log.send(report);
 }
 
diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs
index 8be6439d88c..e39c51dd73a 100644
--- a/src/test/bench/shootout-k-nucleotide-pipes.rs
+++ b/src/test/bench/shootout-k-nucleotide-pipes.rs
@@ -129,11 +129,11 @@ fn make_sequence_processor(sz: uint,
    let buffer = match sz {
        1u => { sort_and_fmt(&freqs, total) }
        2u => { sort_and_fmt(&freqs, total) }
-       3u => { format_strbuf!("{}\t{}", find(&freqs, "GGT".to_string()), "GGT") }
-       4u => { format_strbuf!("{}\t{}", find(&freqs, "GGTA".to_string()), "GGTA") }
-       6u => { format_strbuf!("{}\t{}", find(&freqs, "GGTATT".to_string()), "GGTATT") }
-      12u => { format_strbuf!("{}\t{}", find(&freqs, "GGTATTTTAATT".to_string()), "GGTATTTTAATT") }
-      18u => { format_strbuf!("{}\t{}", find(&freqs, "GGTATTTTAATTTATAGT".to_string()),
+       3u => { format!("{}\t{}", find(&freqs, "GGT".to_string()), "GGT") }
+       4u => { format!("{}\t{}", find(&freqs, "GGTA".to_string()), "GGTA") }
+       6u => { format!("{}\t{}", find(&freqs, "GGTATT".to_string()), "GGTATT") }
+      12u => { format!("{}\t{}", find(&freqs, "GGTATTTTAATT".to_string()), "GGTATTTTAATT") }
+      18u => { format!("{}\t{}", find(&freqs, "GGTATTTTAATTTATAGT".to_string()),
                        "GGTATTTTAATTTATAGT") }
         _ => { "".to_string() }
    };
diff --git a/src/test/compile-fail/issue-13428.rs b/src/test/compile-fail/issue-13428.rs
index 85bad9f8d60..de558401aa6 100644
--- a/src/test/compile-fail/issue-13428.rs
+++ b/src/test/compile-fail/issue-13428.rs
@@ -11,8 +11,8 @@
 // Regression test for #13428
 
 fn foo() -> String {  //~ ERROR not all control paths return a value
-    format_strbuf!("Hello {}",
-                   "world")
+    format!("Hello {}",
+            "world")
     // Put the trailing semicolon on its own line to test that the
     // note message gets the offending semicolon exactly
     ;   //~ NOTE consider removing this semicolon
diff --git a/src/test/run-fail/explicit-fail-msg.rs b/src/test/run-fail/explicit-fail-msg.rs
index 9160b760c92..f860fdffba1 100644
--- a/src/test/run-fail/explicit-fail-msg.rs
+++ b/src/test/run-fail/explicit-fail-msg.rs
@@ -15,5 +15,5 @@
 fn main() {
     let mut a = 1;
     if 1 == 1 { a = 2; }
-    fail!(format_strbuf!("woooo{}", "o"));
+    fail!(format!("woooo{}", "o"));
 }
diff --git a/src/test/run-fail/unwind-lambda.rs b/src/test/run-fail/unwind-lambda.rs
index 00183aa674f..336df3ff965 100644
--- a/src/test/run-fail/unwind-lambda.rs
+++ b/src/test/run-fail/unwind-lambda.rs
@@ -20,10 +20,10 @@ fn main() {
         macerate((*tasties).clone());
     });
     result(carrots, |food| {
-        let mush = format_strbuf!("{}{}", food, cheese);
+        let mush = format!("{}{}", food, cheese);
         let cheese = cheese.clone();
         let f: || = || {
-            let _chew = format_strbuf!("{}{}", mush, cheese);
+            let _chew = format!("{}{}", mush, cheese);
             fail!("so yummy")
         };
         f();
diff --git a/src/test/run-pass/autoref-intermediate-types-issue-3585.rs b/src/test/run-pass/autoref-intermediate-types-issue-3585.rs
index e10428e3c5d..270f85114ea 100644
--- a/src/test/run-pass/autoref-intermediate-types-issue-3585.rs
+++ b/src/test/run-pass/autoref-intermediate-types-issue-3585.rs
@@ -16,13 +16,13 @@ trait Foo {
 
 impl<T:Foo> Foo for @T {
     fn foo(&self) -> String {
-        format_strbuf!("@{}", (**self).foo())
+        format!("@{}", (**self).foo())
     }
 }
 
 impl Foo for uint {
     fn foo(&self) -> String {
-        format_strbuf!("{}", *self)
+        format!("{}", *self)
     }
 }
 
diff --git a/src/test/run-pass/bug-7183-generics.rs b/src/test/run-pass/bug-7183-generics.rs
index 7ed5f5aef9f..239247cdd18 100644
--- a/src/test/run-pass/bug-7183-generics.rs
+++ b/src/test/run-pass/bug-7183-generics.rs
@@ -19,15 +19,15 @@ fn hello<S:Speak>(s:&S) -> String{
 
 impl Speak for int {
     fn say(&self, s:&str) -> String {
-        format_strbuf!("{}: {}", s, *self)
+        format!("{}: {}", s, *self)
     }
 }
 
 impl<T: Speak> Speak for Option<T> {
     fn say(&self, s:&str) -> String {
         match *self {
-            None => format_strbuf!("{} - none", s),
-            Some(ref x) => { format_strbuf!("something!{}", x.say(s)) }
+            None => format!("{} - none", s),
+            Some(ref x) => { format!("something!{}", x.say(s)) }
         }
     }
 }
diff --git a/src/test/run-pass/closure-reform.rs b/src/test/run-pass/closure-reform.rs
index 5de7aee4aa4..c05f2502a89 100644
--- a/src/test/run-pass/closure-reform.rs
+++ b/src/test/run-pass/closure-reform.rs
@@ -50,15 +50,15 @@ pub fn main() {
 
     let greeting = "Hello ".to_string();
     call_it(proc(s) {
-        format_strbuf!("{}{}", greeting, s)
+        format!("{}{}", greeting, s)
     });
 
     let greeting = "Goodbye ".to_string();
-    call_it(proc(s) format_strbuf!("{}{}", greeting, s));
+    call_it(proc(s) format!("{}{}", greeting, s));
 
     let greeting = "How's life, ".to_string();
     call_it(proc(s: String) -> String {
-        format_strbuf!("{}{}", greeting, s)
+        format!("{}{}", greeting, s)
     });
 
     // Closures
diff --git a/src/test/run-pass/issue-2804.rs b/src/test/run-pass/issue-2804.rs
index fa5cd972029..4e5dea82cf4 100644
--- a/src/test/run-pass/issue-2804.rs
+++ b/src/test/run-pass/issue-2804.rs
@@ -45,7 +45,7 @@ fn add_interface(_store: int, managed_ip: String, data: json::Json) -> (String,
             let name = lookup((*interface).clone(),
                               "ifDescr".to_string(),
                               "".to_string());
-            let label = format_strbuf!("{}-{}", managed_ip, name);
+            let label = format!("{}-{}", managed_ip, name);
 
             (label, bool_value(false))
         }
diff --git a/src/test/run-pass/issue-8898.rs b/src/test/run-pass/issue-8898.rs
index ac0ac95c73b..323fff76efb 100644
--- a/src/test/run-pass/issue-8898.rs
+++ b/src/test/run-pass/issue-8898.rs
@@ -13,7 +13,7 @@
 extern crate debug;
 
 fn assert_repr_eq<T>(obj : T, expected : String) {
-    assert_eq!(expected, format_strbuf!("{:?}", obj));
+    assert_eq!(expected, format!("{:?}", obj));
 }
 
 pub fn main() {
diff --git a/src/test/run-pass/log-knows-the-names-of-variants-in-std.rs b/src/test/run-pass/log-knows-the-names-of-variants-in-std.rs
index d26075af3ce..cb7a5989430 100644
--- a/src/test/run-pass/log-knows-the-names-of-variants-in-std.rs
+++ b/src/test/run-pass/log-knows-the-names-of-variants-in-std.rs
@@ -17,19 +17,19 @@ enum foo {
 }
 
 fn check_log<T>(exp: String, v: T) {
-    assert_eq!(exp, format_strbuf!("{:?}", v));
+    assert_eq!(exp, format!("{:?}", v));
 }
 
 pub fn main() {
     let mut x = Some(a(22u));
     let exp = "Some(a(22u))".to_string();
-    let act = format_strbuf!("{:?}", x);
+    let act = format!("{:?}", x);
     assert_eq!(act, exp);
     check_log(exp, x);
 
     x = None;
     let exp = "None".to_string();
-    let act = format_strbuf!("{:?}", x);
+    let act = format!("{:?}", x);
     assert_eq!(act, exp);
     check_log(exp, x);
 }
diff --git a/src/test/run-pass/log-knows-the-names-of-variants.rs b/src/test/run-pass/log-knows-the-names-of-variants.rs
index 2956a030faa..e6a23d99290 100644
--- a/src/test/run-pass/log-knows-the-names-of-variants.rs
+++ b/src/test/run-pass/log-knows-the-names-of-variants.rs
@@ -21,7 +21,7 @@ enum bar {
 }
 
 pub fn main() {
-    assert_eq!("a(22u)".to_string(), format_strbuf!("{:?}", a(22u)));
-    assert_eq!("c".to_string(), format_strbuf!("{:?}", c));
-    assert_eq!("d".to_string(), format_strbuf!("{:?}", d));
+    assert_eq!("a(22u)".to_string(), format!("{:?}", a(22u)));
+    assert_eq!("c".to_string(), format!("{:?}", c));
+    assert_eq!("d".to_string(), format!("{:?}", d));
 }
diff --git a/src/test/run-pass/match-borrowed_str.rs b/src/test/run-pass/match-borrowed_str.rs
index a74f3e83326..b359614fa9a 100644
--- a/src/test/run-pass/match-borrowed_str.rs
+++ b/src/test/run-pass/match-borrowed_str.rs
@@ -22,7 +22,7 @@ fn f2(ref_string: &str) -> String {
     match ref_string {
         "a" => "found a".to_string(),
         "b" => "found b".to_string(),
-        s => format_strbuf!("not found ({})", s)
+        s => format!("not found ({})", s)
     }
 }
 
@@ -38,7 +38,7 @@ fn g2(ref_1: &str, ref_2: &str) -> String {
     match (ref_1, ref_2) {
         ("a", "b") => "found a,b".to_string(),
         ("b", "c") => "found b,c".to_string(),
-        (s1, s2) => format_strbuf!("not found ({}, {})", s1, s2)
+        (s1, s2) => format!("not found ({}, {})", s1, s2)
     }
 }
 
diff --git a/src/test/run-pass/monad.rs b/src/test/run-pass/monad.rs
index 4642978d46c..3ad5da31701 100644
--- a/src/test/run-pass/monad.rs
+++ b/src/test/run-pass/monad.rs
@@ -45,8 +45,8 @@ pub fn main() {
     assert_eq!(transform(Some(10)), Some("11".to_string()));
     assert_eq!(transform(None), None);
     assert!((vec!("hi".to_string()))
-        .bind(|x| vec!(x.clone(), format_strbuf!("{}!", x)) )
-        .bind(|x| vec!(x.clone(), format_strbuf!("{}?", x)) ) ==
+        .bind(|x| vec!(x.clone(), format!("{}!", x)) )
+        .bind(|x| vec!(x.clone(), format!("{}?", x)) ) ==
         vec!("hi".to_string(),
              "hi?".to_string(),
              "hi!".to_string(),
diff --git a/src/test/run-pass/process-spawn-with-unicode-params.rs b/src/test/run-pass/process-spawn-with-unicode-params.rs
index 0bfa2a75cf5..70839c18847 100644
--- a/src/test/run-pass/process-spawn-with-unicode-params.rs
+++ b/src/test/run-pass/process-spawn-with-unicode-params.rs
@@ -36,8 +36,7 @@ fn main() {
     let blah       = "\u03c0\u042f\u97f3\u00e6\u221e";
 
     let child_name = "child";
-    let child_dir  = format_strbuf!("process-spawn-with-unicode-params-{}",
-                                    blah);
+    let child_dir  = format!("process-spawn-with-unicode-params-{}", blah);
 
     // parameters sent to child / expected to be received from parent
     let arg = blah;
diff --git a/src/test/run-pass/send_str_treemap.rs b/src/test/run-pass/send_str_treemap.rs
index 9c727314ffb..5604093ea9c 100644
--- a/src/test/run-pass/send_str_treemap.rs
+++ b/src/test/run-pass/send_str_treemap.rs
@@ -61,7 +61,7 @@ pub fn main() {
     assert_eq!(map.find(&Owned("def".to_string())), Some(&d));
 
     assert!(map.pop(&Slice("foo")).is_some());
-    assert_eq!(map.move_iter().map(|(k, v)| format_strbuf!("{}{}", k, v))
+    assert_eq!(map.move_iter().map(|(k, v)| format!("{}{}", k, v))
                               .collect::<Vec<String>>()
                               .concat(),
                "abc50bcd51cde52def53".to_string());
diff --git a/src/test/run-pass/str-concat.rs b/src/test/run-pass/str-concat.rs
index 51831a7b1cd..7141d0b9df5 100644
--- a/src/test/run-pass/str-concat.rs
+++ b/src/test/run-pass/str-concat.rs
@@ -14,7 +14,7 @@
 pub fn main() {
     let a: String = "hello".to_string();
     let b: String = "world".to_string();
-    let s: String = format_strbuf!("{}{}", a, b);
+    let s: String = format!("{}{}", a, b);
     println!("{}", s.clone());
     assert_eq!(s.as_slice()[9], 'd' as u8);
 }
diff --git a/src/test/run-pass/string-self-append.rs b/src/test/run-pass/string-self-append.rs
index 4610d1ccfcc..612483f6909 100644
--- a/src/test/run-pass/string-self-append.rs
+++ b/src/test/run-pass/string-self-append.rs
@@ -16,7 +16,7 @@ pub fn main() {
     while i > 0 {
         println!("{}", a.len());
         assert_eq!(a.len(), expected_len);
-        a = format_strbuf!("{}{}", a, a);
+        a = format!("{}{}", a, a);
         i -= 1;
         expected_len *= 2u;
     }
diff --git a/src/test/run-pass/trait-cast.rs b/src/test/run-pass/trait-cast.rs
index 7f0f857090f..454cf4c8eda 100644
--- a/src/test/run-pass/trait-cast.rs
+++ b/src/test/run-pass/trait-cast.rs
@@ -29,7 +29,7 @@ impl<T:to_str> to_str for Option<T> {
     fn to_str_(&self) -> String {
         match *self {
           None => { "none".to_string() }
-          Some(ref t) => format_strbuf!("some({})", t.to_str_()),
+          Some(ref t) => format!("some({})", t.to_str_()),
         }
     }
 }
@@ -46,10 +46,7 @@ impl to_str for Tree {
         let this = t.borrow();
         let (l, r) = (this.left, this.right);
         let val = &this.val;
-        format_strbuf!("[{}, {}, {}]",
-                       val.to_str_(),
-                       l.to_str_(),
-                       r.to_str_())
+        format!("[{}, {}, {}]", val.to_str_(), l.to_str_(), r.to_str_())
     }
 }
 
diff --git a/src/test/run-pass/trait-to-str.rs b/src/test/run-pass/trait-to-str.rs
index 7fe5b327f2f..ea5e0a9ee91 100644
--- a/src/test/run-pass/trait-to-str.rs
+++ b/src/test/run-pass/trait-to-str.rs
@@ -20,11 +20,11 @@ impl to_str for int {
 
 impl<T:to_str> to_str for Vec<T> {
     fn to_string(&self) -> String {
-        format_strbuf!("[{}]",
-                       self.iter()
-                           .map(|e| e.to_string())
-                           .collect::<Vec<String>>()
-                           .connect(", "))
+        format!("[{}]",
+                self.iter()
+                    .map(|e| e.to_string())
+                    .collect::<Vec<String>>()
+                    .connect(", "))
     }
 }
 
@@ -33,7 +33,7 @@ pub fn main() {
     assert!((vec!(2, 3, 4)).to_string() == "[2, 3, 4]".to_string());
 
     fn indirect<T:to_str>(x: T) -> String {
-        format_strbuf!("{}!", x.to_string())
+        format!("{}!", x.to_string())
     }
     assert!(indirect(vec!(10, 20)) == "[10, 20]!".to_string());
 
diff --git a/src/test/run-pass/traits-default-method-macro.rs b/src/test/run-pass/traits-default-method-macro.rs
index 8b0d8533c56..29fc2fd5a7a 100644
--- a/src/test/run-pass/traits-default-method-macro.rs
+++ b/src/test/run-pass/traits-default-method-macro.rs
@@ -11,7 +11,7 @@
 
 trait Foo {
     fn bar(&self) -> String {
-        format_strbuf!("test")
+        format!("test")
     }
 }