mirror of
https://github.com/Swatinem/rust-cache
synced 2026-09-14 20:13:25 +00:00
Support for trybuild and similar macro testing tools (#168)
Signed-off-by: Filippo Costa <filippo@neysofu.me>
This commit is contained in:
@@ -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");
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
fn main() {}
|
||||
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
"foobar".foobar();
|
||||
}
|
||||
@@ -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`
|
||||
Reference in New Issue
Block a user