1
1
mirror of https://github.com/oxalica/nil.git synced 2024-11-22 02:55:39 +03:00

Remove trailing spaces in tests

This commit is contained in:
oxalica 2023-10-17 02:25:15 +08:00
parent b4a01cee32
commit 1b6b4534b3
4 changed files with 10 additions and 8 deletions

View File

@ -144,7 +144,7 @@ mod tests {
${g} = 3;
};
}
",
",
expect![[r#"
{

View File

@ -316,7 +316,7 @@ rec {
foo = rec { };
$0foo = { a = 42; };
}
",
",
expect![[r#"
{
foo = rec {
@ -343,7 +343,7 @@ rec {
d = 3;
};
}
",
",
expect![[r#"
{
foo = {

View File

@ -796,7 +796,7 @@ mod tests {
inputs.nixpkgs.url = "...";
outputs = { n$0 }: { };
}
"#,
"#,
"nixpkgs",
expect![[r#"
(Param) {
@ -815,7 +815,7 @@ mod tests {
{
nix.e$0
}
",
",
"enable",
expect![[r#"
(Field) { ... }:
@ -830,7 +830,7 @@ mod tests {
{
notexists.e$0
}
",
",
"enable",
);
check_no(
@ -839,7 +839,7 @@ mod tests {
stdenv.mkDerivation {
nix.e$0
}
",
",
"enable",
);
}

View File

@ -182,7 +182,9 @@ impl Fixture {
fn insert_file(&mut self, path: VfsPath, mut text: String) -> Result<()> {
let file = FileId(self.files.len() as u32);
text.truncate(text.trim_end().len());
// Trim the last newline for simplicity. But whitespaces are kept since markers may be
// pointing to them.
text.truncate(text.trim_end_matches('\n').len());
ensure!(
self.files.insert(path.clone(), text).is_none(),
"Duplicated path: {:?}",