From dcfc95e563b8e91987283fd5afb6461133972d1b Mon Sep 17 00:00:00 2001 From: WillLillis Date: Sat, 11 Jan 2025 16:53:29 -0500 Subject: [PATCH] fix(cli): only remove test input's trailing '\r' if running on windows platform --- cli/src/test.rs | 1 + .../anonymous_tokens_with_escaped_chars/corpus.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/src/test.rs b/cli/src/test.rs index 9fdaec2d..1e73c640 100644 --- a/cli/src/test.rs +++ b/cli/src/test.rs @@ -898,6 +898,7 @@ fn parse_test_content(name: String, content: &str, file_path: Option) - // Remove trailing newline from the input. input.pop(); + #[cfg(target_os = "windows")] if input.last() == Some(&b'\r') { input.pop(); } diff --git a/test/fixtures/test_grammars/anonymous_tokens_with_escaped_chars/corpus.txt b/test/fixtures/test_grammars/anonymous_tokens_with_escaped_chars/corpus.txt index 749264c6..c69d0484 100644 --- a/test/fixtures/test_grammars/anonymous_tokens_with_escaped_chars/corpus.txt +++ b/test/fixtures/test_grammars/anonymous_tokens_with_escaped_chars/corpus.txt @@ -19,7 +19,7 @@ anonymous tokens defined with LF escape sequence anonymous tokens defined with CR escape sequence ================================================= - + --- (first_rule)