3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2025-09-01 01:04:56 +00:00

Support for trybuild and similar macro testing tools (#168)

Signed-off-by: Filippo Costa <filippo@neysofu.me>
This commit is contained in:
Filippo Neysofu Costa 2023-09-12 19:32:03 +02:00 committed by GitHub
parent 44b6087283
commit 67c46e7159
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 138 additions and 2 deletions

6
tests/tests/trybuild.rs Normal file
View file

@ -0,0 +1,6 @@
#[test]
fn test_trybuild() {
let t = trybuild::TestCases::new();
t.pass("tests/trybuild/empty_main.rs");
t.compile_fail("tests/trybuild/fail_to_compile.rs");
}

View file

@ -0,0 +1 @@
fn main() {}

View file

@ -0,0 +1,3 @@
fn main() {
"foobar".foobar();
}

View file

@ -0,0 +1,5 @@
error[E0599]: no method named `foobar` found for reference `&'static str` in the current scope
--> tests/trybuild/fail_to_compile.rs:2:14
|
2 | "foobar".foobar();
| ^^^^^^ method not found in `&str`