mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-21 16:41:01 -05:00
test: Make platform agnostic
This commit is contained in:
parent
6dd7cbfe7b
commit
c49aff00be
6 changed files with 31 additions and 9 deletions
|
@ -11,7 +11,12 @@ fn codegen() {
|
|||
}
|
||||
|
||||
fn generate<W: std::io::Write>(file: &mut W) {
|
||||
writeln!(file, "// This file is @generated {}", file!()).unwrap();
|
||||
writeln!(
|
||||
file,
|
||||
"// This file is @generated {}",
|
||||
file!().replace('\\', "/")
|
||||
)
|
||||
.unwrap();
|
||||
writeln!(file).unwrap();
|
||||
|
||||
let dict = parse_dict(DICT);
|
||||
|
|
|
@ -13,7 +13,12 @@ fn codegen() {
|
|||
}
|
||||
|
||||
fn generate<W: std::io::Write>(file: &mut W) {
|
||||
writeln!(file, "// This file is @generated by {}", file!()).unwrap();
|
||||
writeln!(
|
||||
file,
|
||||
"// This file is @generated by {}",
|
||||
file!().replace('\\', "/")
|
||||
)
|
||||
.unwrap();
|
||||
writeln!(file).unwrap();
|
||||
|
||||
let Words {
|
||||
|
|
|
@ -11,7 +11,12 @@ fn codegen() {
|
|||
}
|
||||
|
||||
fn generate<W: std::io::Write>(file: &mut W) {
|
||||
writeln!(file, "// This file is @generated by {}", file!()).unwrap();
|
||||
writeln!(
|
||||
file,
|
||||
"// This file is @generated by {}",
|
||||
file!().replace('\\', "/")
|
||||
)
|
||||
.unwrap();
|
||||
writeln!(file, "#![allow(clippy::unreadable_literal)]",).unwrap();
|
||||
writeln!(file).unwrap();
|
||||
|
||||
|
|
|
@ -25,7 +25,12 @@ static CATEGORIES: [varcon::Category; 4] = [
|
|||
fn generate_variations<W: std::io::Write>(file: &mut W) {
|
||||
let entries = entries();
|
||||
|
||||
writeln!(file, "// This file is @generated by {}", file!(),).unwrap();
|
||||
writeln!(
|
||||
file,
|
||||
"// This file is @generated by {}",
|
||||
file!().replace('\\', "/")
|
||||
)
|
||||
.unwrap();
|
||||
writeln!(
|
||||
file,
|
||||
"#![allow(clippy::unreadable_literal, clippy::type_complexity)]",
|
||||
|
|
|
@ -7,10 +7,7 @@ fn codegen() {
|
|||
|
||||
let content = String::from_utf8(content).unwrap();
|
||||
let content = codegenrs::rustfmt(&content, None).unwrap();
|
||||
snapbox::Assert::new()
|
||||
.normalize_paths(false)
|
||||
.action_env(snapbox::DEFAULT_ACTION_ENV)
|
||||
.eq_path("./src/codegen.rs", content);
|
||||
snapbox::assert_eq_path("./src/codegen.rs", content);
|
||||
}
|
||||
|
||||
fn generate<W: std::io::Write>(file: &mut W) {
|
||||
|
|
|
@ -11,7 +11,12 @@ fn codegen() {
|
|||
}
|
||||
|
||||
fn generate<W: std::io::Write>(file: &mut W) {
|
||||
writeln!(file, "// This file is @generated by {}", file!()).unwrap();
|
||||
writeln!(
|
||||
file,
|
||||
"// This file is @generated by {}",
|
||||
file!().replace('\\', "/")
|
||||
)
|
||||
.unwrap();
|
||||
writeln!(file).unwrap();
|
||||
|
||||
let dict = parse_dict(DICT);
|
||||
|
|
Loading…
Reference in a new issue