Debian Codegraph @

debian/missing-sources/glib/tests/regex_compiletest.rs

raw
1 #[test]
2 pub fn test() {
3 let t = trybuild2::TestCases::new();
4
5 t.pass("tests/regex_compiletest/01-not-dangling.rs");
6 // The exact error message format changed sometime between 1.70.0 and 1.73.0,
7 // so the .stderr file would be incorrect for at least one CI run,
8 // so use compile_fail_check_sub instead of compile_fail.
9 t.compile_fail_check_sub(
10 "tests/regex_compiletest/02-dangling.rs",
11 "error[E0505]: cannot move out of `s` because it is borrowed",
12 );
13
14 t.pass("tests/regex_compiletest/03-static-value.rs");
15 // See above about 02
16 t.compile_fail_check_sub(
17 "tests/regex_compiletest/04-nonstatic-value.rs",
18 "argument requires that `s` is borrowed for `'static`",
19 );
20
21 // Don't use check_sub: Check the exact error message to ensure that only the contravariance check fails.
22 t.compile_fail("tests/regex_compiletest/05-variance.rs");
23
24 t.pass("tests/regex_compiletest/06-property.rs");
25 }