Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new test cases #100

Merged
merged 12 commits into from
Dec 27, 2021
34 changes: 34 additions & 0 deletions src/2G84.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
- name: Literal modifers
from: '@ingydotnet'
tags: literal scalar
fail: true
yaml: |
--- |0
tree: |
+STR
+DOC ---

- fail: true
yaml: |
--- |10

- yaml: |
--- |1-∎
tree: |-
+STR
+DOC ---
=VAL |
-DOC
-STR
json: |
""

- yaml: |
--- |1+∎
tree: |-
+STR
+DOC ---
=VAL |
-DOC
-STR
13 changes: 13 additions & 0 deletions src/4MUZ.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,16 @@
}
emit: |
"foo": "bar"

- yaml: |
{"foo"
: bar}
tree: |-
+STR
+DOC
+MAP {}
=VAL "foo
=VAL :bar
-MAP
-DOC
-STR
23 changes: 23 additions & 0 deletions src/4RWC.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
- name: Trailing spaces after flow collection
tags: flow whitespace
from: '@ingydotnet'
yaml: |2
[1, 2, 3]␣␣
␣␣∎
tree: |-
+STR
+DOC
+SEQ []
=VAL :1
=VAL :2
=VAL :3
-SEQ
-DOC
-STR
json: |
[
1,
2,
3
]
19 changes: 19 additions & 0 deletions src/58MP.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
- name: Flow mapping edge cases
from: '@ingydotnet'
tags: edge flow mapping
yaml: |
{x: :x}
tree: |-
+STR
+DOC
+MAP {}
=VAL :x
=VAL ::x
-MAP
-DOC
-STR
json: |
{
"x": ":x"
}
20 changes: 20 additions & 0 deletions src/C4WK.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
- name: Flow mapping edge cases
from: '@ingydotnet'
tags: edge
yaml: |
{x
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one would also be a good candidate to include in 4MUZ maybe?

: y}
tree: |-
+STR
+DOC
+MAP {}
=VAL :x
=VAL :y
-MAP
-DOC
-STR
json: |
{
"x": "y"
}
33 changes: 33 additions & 0 deletions src/HM87.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
- name: Scalars in flow start with syntax char
from: '@ingydotnet'
tags: flow scalar
yaml: |
[:x]
tree: |-
+STR
+DOC
+SEQ []
=VAL ::x
-SEQ
-DOC
-STR
json: |
[
":x"
]

- yaml: |
[?x]
tree: |-
+STR
+DOC
+SEQ []
=VAL :?x
-SEQ
-DOC
-STR
json: |
[
"?x"
]
21 changes: 18 additions & 3 deletions src/JEF9.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
- skip: true
name: Trailing whitespace in streams
- name: Trailing whitespace in streams
from: '@ingydotnet'
tags: literal
yaml: |
Expand All @@ -11,14 +10,30 @@
+STR
+DOC
+SEQ
=VAL |
=VAL |\n\n
-SEQ
-DOC
-STR
json: |
[
"\n\n"
]

- yaml: |
- |+
␣␣␣
tree: |
+STR
+DOC
+SEQ
=VAL |\n
-SEQ
-DOC
-STR
json: |
[
"\n"
]

- yaml: |
- |+
Expand Down
36 changes: 36 additions & 0 deletions src/M2N8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
- name: Question mark edge cases
from: '@ingydotnet'
tags: edge empty-key
yaml: |
- ? : x
tree: |-
+STR
+DOC
+SEQ
+MAP
+MAP
=VAL :
=VAL :x
-MAP
=VAL :
-MAP
-SEQ
-DOC
-STR

- yaml: |
? []: x
tree: |-
+STR
+DOC
+MAP
+MAP
+SEQ []
-SEQ
=VAL :x
-MAP
=VAL :
-MAP
-DOC
-STR
46 changes: 46 additions & 0 deletions src/MUS6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
- name: Directive variants
from: '@ingydotnet'
tags: directive
also: ZYU8
fail: true
yaml: |
%YAML 1.1#...
---
tree: |
+STR

- fail: true
yaml: |
%YAML 1.2
---
%YAML 1.2
---

- yaml: |
%YAML 1.1
---
tree: |-
+STR
+DOC ---
=VAL :
-DOC
-STR
json: |
null

- yaml: |
%YAML ——» 1.1
---

- yaml: |
%YAML 1.1 # comment
---

- note: These 2 are reserved directives
yaml: |
%YAM 1.1
---

- yaml: |
%YAMLL 1.1
---
43 changes: 43 additions & 0 deletions src/UKK6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
- name: Syntax character edge cases
from: '@ingydotnet'
tags: edge empty-key
yaml: |
- :
tree: |-
+STR
+DOC
+SEQ
+MAP
=VAL :
=VAL :
-MAP
-SEQ
-DOC
-STR

- yaml: |
::
tree: |-
+STR
+DOC
+MAP
=VAL ::
=VAL :
-MAP
-DOC
-STR
json: |
{
":": null
}

- yaml: |
!
tree: |-
+STR
+DOC
=VAL <!> :
-DOC
-STR
json: null
25 changes: 25 additions & 0 deletions src/UV7Q.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
- name: Legal tab after indentation
from: '@ingydotnet'
tags: indent whitespace
yaml: |
x:
- x
——»x
tree: |-
+STR
+DOC
+MAP
=VAL :x
+SEQ
=VAL :x x
-SEQ
-MAP
-DOC
-STR
json: |
{
"x": [
"x x"
]
}
Loading