Skip to content

Commit

Permalink
test all cases of an indicator character by itself
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Ruoss <michael@michaelruoss.ch>
  • Loading branch information
mlwilkerson and mruoss committed Dec 27, 2023
1 parent f573ffb commit 910d53d
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion test/ymlr/encode_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,31 @@ defmodule Ymlr.EncodeTest do
assert_identity_and_output("hello #world", ~S('hello #world'))
end

test "quoted strings - starts with special char" do
test "quoted strings - indicator characters on their own" do
assert_identity_and_output("-", ~S('-'))
assert_identity_and_output("?", ~S('?'))
assert_identity_and_output(":", ~S(':'))
assert_identity_and_output("[", ~S('['))
assert_identity_and_output("]", ~S(']'))
assert_identity_and_output("{", ~S('{'))
assert_identity_and_output("}", ~S('}'))
assert_identity_and_output("#", ~S('#'))
assert_identity_and_output("&", ~S('&'))
assert_identity_and_output("&", ~S('&'))
assert_identity_and_output("*", ~S('*'))
assert_identity_and_output("*", ~S('*'))
assert_identity_and_output("!", ~S('!'))
assert_identity_and_output("!", ~S('!'))
assert_identity_and_output("|", ~S('|'))
assert_identity_and_output("|", ~S('|'))
assert_identity_and_output(">", ~S('>'))
assert_identity_and_output(">", ~S('>'))
assert_identity_and_output("%", ~S(%))
assert_identity_and_output("@", ~S('@'))
assert_identity_and_output("`", ~S('`'))
end

test "quoted strings - starts with special char" do
assert_identity_and_output("!tag", ~S('!tag'))
assert_identity_and_output("&anchor", ~S('&anchor'))
assert_identity_and_output("*alias", ~S('*alias'))
Expand Down

0 comments on commit 910d53d

Please sign in to comment.