Move proc_macro tests to ui test

This commit is contained in:
David Tolnay 2021-04-29 11:17:44 -07:00
parent 39441bb2c1
commit 3c16c0e1df
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 9 additions and 4 deletions

View File

@ -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) {

View File

@ -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()
}