Skip to content

Commit

Permalink
Add test for using line! in a macro
Browse files Browse the repository at this point in the history
  • Loading branch information
cyndis committed Feb 11, 2013
1 parent f2a8a71 commit d48bc26
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/test/run-pass/syntax-extension-source-utils.rs
Expand Up @@ -17,9 +17,12 @@ pub mod m1 {
}
}

macro_rules! indirect_line( () => ( line!() ) )

pub fn main() {
assert(line!() == 21);
assert(line!() == 23);
assert(col!() == 11);
assert(indirect_line!() == 25);
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()
Expand Down

0 comments on commit d48bc26

Please sign in to comment.