Add test for using line! in a macro

This commit is contained in:
Mikko Perttunen 2013-02-11 20:26:40 +02:00
parent f2a8a71266
commit d48bc263b5
1 changed files with 4 additions and 1 deletions

View File

@ -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()