Skip to content

Commit

Permalink
Merge pull request #234 from GunnarFarneback/revert_eol_attributes
Browse files Browse the repository at this point in the history
Revert eol attributes
  • Loading branch information
kescobo authored Jul 18, 2024
2 parents a440b9a + a6cc71e commit 2bf3845
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 46 deletions.
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

14 changes: 4 additions & 10 deletions test/julia/issue132.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
Any[
Dict{Any, Any}(
"creator" => "LAMMPS",
"timestep" => 0,
),
Dict{Any, Any}(
"creator" => "LAMMPS",
"timestep" => 1,
),
]
Dict{Any, Any}(
"creator" => "LAMMPS",
"timestep" => 0,
)
File renamed without changes.
File renamed without changes.
28 changes: 5 additions & 23 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,20 @@ const tests = [
"spec-02-23",
"empty_scalar",
"no_trailing_newline",
"windows_newlines.crlf",
"windows_newlines",
"escape_sequences",
"issue15",
"issue30",
"issue36",
"issue39",
"issue132",
"cartesian",
"ar1",
"ar1_cartesian",
"merge-01",
"version-colon",
"multi-constructor",
"utf-8-bom.crlf",
"utf-8-bom",
"utf-32-be",
"empty_tag",
"empty_list_elem",
Expand Down Expand Up @@ -433,9 +434,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
Expand All @@ -455,27 +458,6 @@ end
@test YAML.load("---") === nothing
end

# issue #132
@testset "issue #132" begin
docs_expected = evalfile(joinpath(testdir, "julia/issue132.jl"))
open(joinpath(testdir, "yaml/issue132.lf.yaml"), "r") do io
docs = YAML.load_all(io)
doc, i = iterate(docs)
@test isequal(doc, docs_expected[1])
doc, i = iterate(docs, i)
@test isequal(doc, docs_expected[2])
@test iterate(docs, i) === nothing
end
# open(joinpath(testdir, "yaml/issue132.crlf.yaml"), "r") do io
# docs = YAML.load_all(io)
# doc, i = iterate(docs)
# @test isequal(doc, docs_expected[1])
# doc, i = iterate(docs, i)
# @test isequal(doc, docs_expected[2])
# @test iterate(docs, i) === nothing
# end
end

# issue #226 - loadall stops on a null document
@testset "issue #226" begin
@test collect(YAML.load_all("null")) == [nothing]
Expand Down
8 changes: 0 additions & 8 deletions test/yaml/issue132.lf.yaml

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions test/yaml/utf-8-bom.crlf.yaml → test/yaml/utf-8-bom.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
attribute: 1
---
attribute: 1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hello:
hello:

0 comments on commit 2bf3845

Please sign in to comment.