-
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathtrybuild.rs
More file actions
53 lines (50 loc) · 1.69 KB
/
trybuild.rs
File metadata and controls
53 lines (50 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! Add code examples that you expect to compile to tests/good.
//! Add code examples that you expect to fail compilation to tests/bad.
//! Optionally enable/disable the modules below to make local editing easier.
//!
//! Please read the [trybuild workflow][1] docs to understand how to deal with
//! failing test output.
//!
//! [1]: https://github.com/dtolnay/trybuild?tab=readme-ov-file#workflow
// Enable the 'pass' module below to get syntax highlighting and code completion.
// Adjust the list of modules to enable syntax highlighting and code completion.
// Unfortunately tests in sub-folders aren't automatically included.
//
// Similar to the above 'pass' module, enable the 'fail' module below to get
// syntax highlighting and code completion. You will need to comment them out
// again but before running tests, otherwise compilation will fail (as expected).
#[allow(dead_code)]
mod inputs {
mod pass {
// mod added;
// mod basic;
// mod conversion_hints;
// mod conversion_tracking_hints;
// mod conversion_tracking;
// mod crate_overrides;
// mod docs;
// mod downgrade_with;
// mod enum_fields;
// mod module;
// mod module_preserve;
// mod renamed_field;
// mod renamed_kind;
// mod scale;
// mod shortnames;
// mod submodule;
}
mod fail {
// mod applied_to_struct;
// mod changed;
// mod deprecate;
// mod spec_suffix;
// mod unknown_version;
// mod submodule_invalid_name;
}
}
#[test]
fn ui() {
let t = trybuild::TestCases::new();
t.pass("tests/inputs/pass/*.rs");
t.compile_fail("tests/inputs/fail/*.rs");
}