-
Notifications
You must be signed in to change notification settings - Fork 623
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(yaml): simplify and rename
dropEndingNewline()
(#5336)
- Loading branch information
1 parent
ce0c1e2
commit 424a113
Showing
2 changed files
with
17 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. | ||
|
||
import { assertEquals } from "@std/assert"; | ||
import { trimTrailingNewline } from "./_dumper.ts"; | ||
|
||
Deno.test("trimTrailingNewline()", async (t) => { | ||
await t.step("handles string without trailing newline", () => { | ||
assertEquals(trimTrailingNewline("hello\nworld"), "hello\nworld"); | ||
}); | ||
await t.step("handles string with trailing newline", () => { | ||
assertEquals(trimTrailingNewline("hello\nworld\n"), "hello\nworld"); | ||
}); | ||
}); |