aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/syntax-extension-fmt.rs
diff options
context:
space:
mode:
authorBrian Anderson <[email protected]>2011-03-07 21:21:01 -0500
committerBrian Anderson <[email protected]>2011-03-07 21:21:01 -0500
commit9fc4db6b89213afdf45c02fc2bd2be62b0ddc40c (patch)
tree6c84574116273f91cbe89abd256b9f809adf97de /src/test/run-pass/syntax-extension-fmt.rs
parentAllow the else part of an expr_if to be either expr_if or expr_block (diff)
parentrustc: Cast the LLVM representations of tag types when constructing boxes. Un... (diff)
downloadrust-9fc4db6b89213afdf45c02fc2bd2be62b0ddc40c.tar.xz
rust-9fc4db6b89213afdf45c02fc2bd2be62b0ddc40c.zip
Merge branch 'master' into recursive-elseif
Conflicts: src/Makefile src/comp/front/ast.rs src/comp/front/parser.rs src/comp/middle/fold.rs src/comp/middle/trans.rs
Diffstat (limited to 'src/test/run-pass/syntax-extension-fmt.rs')
-rw-r--r--src/test/run-pass/syntax-extension-fmt.rs15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/test/run-pass/syntax-extension-fmt.rs b/src/test/run-pass/syntax-extension-fmt.rs
index 65e7647e..ebb09f96 100644
--- a/src/test/run-pass/syntax-extension-fmt.rs
+++ b/src/test/run-pass/syntax-extension-fmt.rs
@@ -1,5 +1,16 @@
use std;
+import std._str;
+
+fn test(str actual, str expected) {
+ log actual;
+ log expected;
+ check (_str.eq(actual, expected));
+}
+
fn main() {
- auto s = #fmt("hello %d friends and %s things", 10, "formatted");
- log s;
+ test(#fmt("hello %d friends and %s things", 10, "formatted"),
+ "hello 10 friends and formatted things");
+ test(#fmt("d: %d", 1), "d: 1");
+ test(#fmt("i: %i", 2), "i: 2");
+ test(#fmt("s: %s", "test"), "s: test");
}