From a6cc71e0066570bb478f886dbfbbb08b7c178456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gunnar=20Farneb=C3=A4ck?= Date: Fri, 28 Jun 2024 17:49:27 +0200 Subject: [PATCH] Add back test files for issue #132 but run them with the other files. Revise an in-memory test of #132 to actually test windows newlines. Add back revision of windows_newlines.yaml. --- test/julia/issue132.jl | 4 ++++ test/runtests.jl | 3 +++ test/yaml/issue132.yaml | 8 ++++++++ test/yaml/windows_newlines.yaml | 1 - 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 test/julia/issue132.jl create mode 100644 test/yaml/issue132.yaml diff --git a/test/julia/issue132.jl b/test/julia/issue132.jl new file mode 100644 index 0000000..60bf1a2 --- /dev/null +++ b/test/julia/issue132.jl @@ -0,0 +1,4 @@ +Dict{Any, Any}( + "creator" => "LAMMPS", + "timestep" => 0, +) diff --git a/test/runtests.jl b/test/runtests.jl index 5d776a5..d26c7c9 100755 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -39,6 +39,7 @@ const tests = [ "issue30", "issue36", "issue39", + "issue132", "cartesian", "ar1", "ar1_cartesian", @@ -407,9 +408,11 @@ end timestep: 1 ... """ + input_crlf = replace(input, "\n" => "\r\n") expected = [Dict("creator" => "LAMMPS", "timestep" => 0), Dict("creator" => "LAMMPS", "timestep" => 1)] @test collect(YAML.load_all(input)) == expected + @test collect(YAML.load_all(input_crlf)) == expected end # issue #148 - warn unknown directives diff --git a/test/yaml/issue132.yaml b/test/yaml/issue132.yaml new file mode 100644 index 0000000..4f569fa --- /dev/null +++ b/test/yaml/issue132.yaml @@ -0,0 +1,8 @@ +--- +creator: LAMMPS +timestep: 0 +... +--- +creator: LAMMPS +timestep: 1 +... diff --git a/test/yaml/windows_newlines.yaml b/test/yaml/windows_newlines.yaml index 4e3cf3d..a28e51b 100644 --- a/test/yaml/windows_newlines.yaml +++ b/test/yaml/windows_newlines.yaml @@ -1,2 +1 @@ hello: - \ No newline at end of file