Skip to content

Commit d48bc26

Browse files
committed
Add test for using line! in a macro
1 parent f2a8a71 commit d48bc26

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/test/run-pass/syntax-extension-source-utils.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ pub mod m1 {
1717
}
1818
}
1919

20+
macro_rules! indirect_line( () => ( line!() ) )
21+
2022
pub fn main() {
21-
assert(line!() == 21);
23+
assert(line!() == 23);
2224
assert(col!() == 11);
25+
assert(indirect_line!() == 25);
2326
assert(file!().to_owned().ends_with(~"syntax-extension-source-utils.rs"));
2427
assert(stringify!((2*3) + 5).to_owned() == ~"( 2 * 3 ) + 5");
2528
assert(include!("syntax-extension-source-utils-files/includeme.fragment").to_owned()

0 commit comments

Comments
 (0)