Skip to content

Commit

Permalink
fix mistak
Browse files Browse the repository at this point in the history
  • Loading branch information
mruoss committed Oct 18, 2023
1 parent bcc8acd commit 9c4b652
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/ymlr/encode_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ defmodule Ymlr.EncodeTest do
test "quoted strings - escape seq forces double quotes (tab char)" do
assert_encode("a\tb", ~s("a\tb"))
assert_encode("!a\tb", ~s("!a\tb"))
assert_encode(~S(@a\nb), ~s('@a\\nb'))
# Not for explicit backslash:
assert_encode(~S(!a\tb), ~S('!a\tb'))
end

test "quoted strings - listy and mappy things" do
Expand All @@ -112,7 +113,7 @@ defmodule Ymlr.EncodeTest do

test "bitstrings" do
assert_raise Protocol.UndefinedError, ~r/cannot encode a bitstring to YAML/, fn ->
assert MUT.to_s!(<<3::4>>)
MUT.to_s!(<<3::4>>)
end
end

Expand Down Expand Up @@ -191,7 +192,7 @@ defmodule Ymlr.EncodeTest do

test "invalid map key" do
assert_raise ArgumentError, fn ->
assert MUT.to_s!(%{%{a: 1} => 2})
MUT.to_s!(%{%{a: 1} => 2})
end
end

Expand Down Expand Up @@ -280,8 +281,8 @@ defmodule Ymlr.EncodeTest do

test "nested: map / map" do
result =
assert MUT.to_s!(%{a: %{b: 1, c: %{d: 2}}, e: %{f: 3, g: 4}})
|> YamlElixir.read_from_string!()
MUT.to_s!(%{a: %{b: 1, c: %{d: 2}}, e: %{f: 3, g: 4}})
|> YamlElixir.read_from_string!()

assert 2 == result["a"]["c"]["d"]
assert 1 == result["a"]["b"]
Expand Down Expand Up @@ -342,7 +343,6 @@ defmodule Ymlr.EncodeTest do
}
"""

# not working yet => TODO better handling of terminal newlines
assert YamlElixir.read_from_string!(encoded) == given
# assert encoded == expected
assert encoded == expected <> " "
Expand Down

0 comments on commit 9c4b652

Please sign in to comment.