Skip to content

Commit fb783e3

Browse files
committed
Move span tests behind a procmacro2_unstable feature flag
1 parent 3463674 commit fb783e3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/test.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ fn fail() {
6363
fail("'mut");
6464
}
6565

66+
#[cfg(procmacro2_unstable)]
6667
#[test]
6768
fn span_test() {
6869
fn check_spans(p: &str, mut lines: &[(usize, usize, usize, usize)]) {
@@ -110,6 +111,7 @@ testing 123
110111
]);
111112
}
112113

114+
#[cfg(procmacro2_unstable)]
113115
#[cfg(not(feature = "unstable"))]
114116
#[test]
115117
fn default_span() {
@@ -120,10 +122,11 @@ fn default_span() {
120122
assert_eq!(end.line, 1);
121123
assert_eq!(end.column, 0);
122124
let source_file = Span::call_site().source_file();
123-
assert_eq!(source_file.as_str(), "<unspecified>");
125+
assert_eq!(source_file.path().to_string(), "<unspecified>");
124126
assert!(!source_file.is_real());
125127
}
126128

129+
#[cfg(procmacro2_unstable)]
127130
#[test]
128131
fn span_join() {
129132
let source1 =

0 commit comments

Comments
 (0)