Move proc_macro tests to ui test
This commit is contained in:
parent
39441bb2c1
commit
3c16c0e1df
@ -1,8 +1,10 @@
|
||||
#![feature(proc_macro_span)]
|
||||
|
||||
use proc_macro::{LineColumn, Punct};
|
||||
|
||||
#[test]
|
||||
pub fn test() {
|
||||
test_line_column_ord();
|
||||
test_punct_eq();
|
||||
}
|
||||
|
||||
fn test_line_column_ord() {
|
||||
let line0_column0 = LineColumn { line: 0, column: 0 };
|
||||
let line0_column1 = LineColumn { line: 0, column: 1 };
|
||||
@ -11,7 +13,6 @@ fn test_line_column_ord() {
|
||||
assert!(line0_column1 < line1_column0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_punct_eq() {
|
||||
// Good enough if it typechecks, since proc_macro::Punct can't exist in a test.
|
||||
fn _check(punct: Punct) {
|
@ -3,14 +3,18 @@
|
||||
|
||||
#![crate_type = "proc-macro"]
|
||||
#![crate_name = "proc_macro_api_tests"]
|
||||
#![feature(proc_macro_span)]
|
||||
#![deny(dead_code)] // catch if a test function is never called
|
||||
|
||||
extern crate proc_macro;
|
||||
|
||||
mod cmp;
|
||||
|
||||
use proc_macro::TokenStream;
|
||||
|
||||
#[proc_macro]
|
||||
pub fn run(input: TokenStream) -> TokenStream {
|
||||
assert!(input.is_empty());
|
||||
cmp::test();
|
||||
TokenStream::new()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user