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