rust/tests/run-make/weird-output-filenames/rmake.rs
许杰友 Jieyou Xu (Joe) d69cc1ccbf tests: update for rfs rename
2024-07-17 13:34:18 +00:00

20 lines
609 B
Rust

use run_make_support::regex::Regex;
use run_make_support::rfs;
use run_make_support::{cwd, rustc};
fn main() {
let invalid_characters = [".foo.rs", ".foo.bar", "+foo+bar.rs"];
let re = Regex::new(r"invalid character.*in crate name:").unwrap();
for f in invalid_characters {
rfs::copy("foo.rs", f);
let stderr = rustc().input(f).run_fail().stderr_utf8();
assert!(re.is_match(&stderr));
}
rfs::copy("foo.rs", "-foo.rs");
rustc()
.input(cwd().join("-foo.rs"))
.run_fail()
.assert_stderr_contains("crate names cannot start with a `-`");
}