rust/tests/run-make/weird-output-filenames/rmake.rs
Nicholas Nethercote 84ac80f192 Reformat use declarations.
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
2024-07-29 08:26:52 +10:00

19 lines
587 B
Rust

use run_make_support::regex::Regex;
use run_make_support::{cwd, rfs, 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 `-`");
}