mirror of
https://gitee.com/openharmony/third_party_rust_proc-macro2
synced 2024-11-23 15:29:39 +00:00
Move span tests behind a procmacro2_unstable feature flag
This commit is contained in:
parent
3463674c99
commit
fb783e32f0
@ -63,6 +63,7 @@ fn fail() {
|
||||
fail("'mut");
|
||||
}
|
||||
|
||||
#[cfg(procmacro2_unstable)]
|
||||
#[test]
|
||||
fn span_test() {
|
||||
fn check_spans(p: &str, mut lines: &[(usize, usize, usize, usize)]) {
|
||||
@ -110,6 +111,7 @@ testing 123
|
||||
]);
|
||||
}
|
||||
|
||||
#[cfg(procmacro2_unstable)]
|
||||
#[cfg(not(feature = "unstable"))]
|
||||
#[test]
|
||||
fn default_span() {
|
||||
@ -120,10 +122,11 @@ fn default_span() {
|
||||
assert_eq!(end.line, 1);
|
||||
assert_eq!(end.column, 0);
|
||||
let source_file = Span::call_site().source_file();
|
||||
assert_eq!(source_file.as_str(), "<unspecified>");
|
||||
assert_eq!(source_file.path().to_string(), "<unspecified>");
|
||||
assert!(!source_file.is_real());
|
||||
}
|
||||
|
||||
#[cfg(procmacro2_unstable)]
|
||||
#[test]
|
||||
fn span_join() {
|
||||
let source1 =
|
||||
|
Loading…
Reference in New Issue
Block a user