Skip to content

Commit 3c16c0e

Browse files
committed
Move proc_macro tests to ui test
1 parent 39441bb commit 3c16c0e

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

library/proc_macro/tests/test.rs renamed to src/test/ui/proc-macro/auxiliary/api/cmp.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
#![feature(proc_macro_span)]
2-
31
use proc_macro::{LineColumn, Punct};
42

5-
#[test]
3+
pub fn test() {
4+
test_line_column_ord();
5+
test_punct_eq();
6+
}
7+
68
fn test_line_column_ord() {
79
let line0_column0 = LineColumn { line: 0, column: 0 };
810
let line0_column1 = LineColumn { line: 0, column: 1 };
@@ -11,7 +13,6 @@ fn test_line_column_ord() {
1113
assert!(line0_column1 < line1_column0);
1214
}
1315

14-
#[test]
1516
fn test_punct_eq() {
1617
// Good enough if it typechecks, since proc_macro::Punct can't exist in a test.
1718
fn _check(punct: Punct) {

src/test/ui/proc-macro/auxiliary/api/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33

44
#![crate_type = "proc-macro"]
55
#![crate_name = "proc_macro_api_tests"]
6+
#![feature(proc_macro_span)]
67
#![deny(dead_code)] // catch if a test function is never called
78

89
extern crate proc_macro;
910

11+
mod cmp;
12+
1013
use proc_macro::TokenStream;
1114

1215
#[proc_macro]
1316
pub fn run(input: TokenStream) -> TokenStream {
1417
assert!(input.is_empty());
18+
cmp::test();
1519
TokenStream::new()
1620
}

0 commit comments

Comments
 (0)