2012-07-07 01:04:28 +00:00
|
|
|
// This test is brittle!
|
2012-05-15 00:43:31 +00:00
|
|
|
// xfail-pretty - the pretty tests lose path information, breaking #include
|
2012-09-22 01:10:45 +00:00
|
|
|
#[legacy_exports];
|
2012-05-15 00:43:31 +00:00
|
|
|
|
2012-05-18 17:00:49 +00:00
|
|
|
mod m1 {
|
2012-09-22 01:10:45 +00:00
|
|
|
#[legacy_exports];
|
2012-05-18 17:00:49 +00:00
|
|
|
mod m2 {
|
2012-09-22 01:10:45 +00:00
|
|
|
#[legacy_exports];
|
2012-08-23 00:24:52 +00:00
|
|
|
fn where_am_i() -> ~str { module_path!() }
|
2012-05-18 17:00:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-05-15 00:43:31 +00:00
|
|
|
fn main() {
|
2012-10-28 00:14:09 +00:00
|
|
|
assert(line!() == 14);
|
|
|
|
assert(col!() == 11);
|
2012-08-23 00:24:52 +00:00
|
|
|
assert(file!().ends_with(~"syntax-extension-source-utils.rs"));
|
2012-10-28 00:14:09 +00:00
|
|
|
assert(stringify!((2*3) + 5) == ~"(2 * 3) + 5");
|
2012-08-23 00:24:52 +00:00
|
|
|
assert(include!("syntax-extension-source-utils-files/includeme.fragment")
|
2012-07-14 05:57:48 +00:00
|
|
|
== ~"victory robot 6");
|
|
|
|
|
2012-05-18 17:02:21 +00:00
|
|
|
assert(
|
2012-08-23 00:24:52 +00:00
|
|
|
include_str!("syntax-extension-source-utils-files/includeme.fragment")
|
2012-07-14 05:57:48 +00:00
|
|
|
.starts_with(~"/* this is for "));
|
2012-05-18 17:03:27 +00:00
|
|
|
assert(
|
2012-08-23 00:24:52 +00:00
|
|
|
include_bin!("syntax-extension-source-utils-files/includeme.fragment")
|
2012-05-18 17:03:27 +00:00
|
|
|
[1] == (42 as u8)); // '*'
|
2012-05-18 17:00:49 +00:00
|
|
|
// The Windows tests are wrapped in an extra module for some reason
|
2012-07-14 05:57:48 +00:00
|
|
|
assert(m1::m2::where_am_i().ends_with(~"m1::m2"));
|
2012-05-15 00:43:31 +00:00
|
|
|
}
|