core: add macro_rules! for "condition! { c: in -> out; }".
This commit is contained in:
parent
263136d389
commit
8e28f23c60
9 changed files with 58 additions and 35 deletions
|
@ -16,20 +16,20 @@ mod m1 {
|
|||
#[legacy_exports];
|
||||
mod m2 {
|
||||
#[legacy_exports];
|
||||
fn where_am_i() -> ~str { module_path!() }
|
||||
fn where_am_i() -> ~str { (module_path!()).to_owned() }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
assert(line!() == 24);
|
||||
assert(col!() == 11);
|
||||
assert(file!().ends_with(~"syntax-extension-source-utils.rs"));
|
||||
assert(stringify!((2*3) + 5) == ~"( 2 * 3 ) + 5");
|
||||
assert(include!("syntax-extension-source-utils-files/includeme.fragment")
|
||||
assert(file!().to_owned().ends_with(~"syntax-extension-source-utils.rs"));
|
||||
assert(stringify!((2*3) + 5).to_owned() == ~"( 2 * 3 ) + 5");
|
||||
assert(include!("syntax-extension-source-utils-files/includeme.fragment").to_owned()
|
||||
== ~"victory robot 6");
|
||||
|
||||
assert(
|
||||
include_str!("syntax-extension-source-utils-files/includeme.fragment")
|
||||
include_str!("syntax-extension-source-utils-files/includeme.fragment").to_owned()
|
||||
.starts_with(~"/* this is for "));
|
||||
assert(
|
||||
include_bin!("syntax-extension-source-utils-files/includeme.fragment")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue