Skip to content

Potential test cases

Tina Müller (tinita) edited this page Jul 1, 2024 · 11 revisions

Explicit key in flow sequence

libyaml had problems with it

[?]
[?]]
% echo '[?]' | docker run -i --rm yamlio/alpine-runtime-perl /yaml/bin/perl-refparser-event
Parser finished before end of input at /perl5/lib/perl5/YAML/Parser.pm line 4056, <> line 1.

% echo '[?]' | docker run -i --rm yamlio/alpine-runtime-static /yaml/bin/c-libfyaml-event
+STR
+DOC
+SEQ []
=VAL :?
-SEQ
-DOC
-STR

Various flow sequences with empty keys/values

https://github.com/eemeli/yaml/issues/550

% echo '---
[c:]
---
[:]
---
c:
---
:' | docker run -i --rm yamlio/alpine-runtime-perl /yaml/bin/perl-refparser-event
+STR
+DOC ---
+SEQ []
+MAP {}
=VAL :c
=VAL :
-MAP
-SEQ
-DOC
+DOC ---
+SEQ []
+MAP {}
=VAL :
=VAL :
-MAP
-SEQ
-DOC
+DOC ---
+MAP
=VAL :c
=VAL :
-MAP
-DOC
+DOC ---
+MAP
=VAL :
=VAL :
-MAP
-DOC
-STR

Block scalars with explicit indentation & comments

https://github.com/eemeli/yaml/issues/547

% echo 'abc: |5 # no error
      # string 6
     # string 5
    #comment 4
   #comment 3

---

|5 # error at #comment 4
      # string 6
     # string 5
    #comment 4
   #comment 3' | docker run -i --rm yamlio/alpine-runtime-perl /yaml/bin/perl-refparser-event
+STR
+DOC
+MAP
=VAL :abc
=VAL | # string 6\n# string 5\n
-MAP
-DOC
+DOC ---
=VAL |  # string 6\n # string 5\n#comment 4\n
-DOC
-STR

Various playground links

Various

ethiraric on matrix wrote their parser failed on this:

[a: [b: c]]