summaryrefslogtreecommitdiffstats
path: root/test/yaml
diff options
context:
space:
mode:
Diffstat (limited to 'test/yaml')
-rw-r--r--test/yaml/basic1/input.yaml19
-rw-r--r--test/yaml/basic2/input.yaml6
-rw-r--r--test/yaml/basic3/input.yaml7
-rw-r--r--test/yaml/boolean/input.yaml33
-rw-r--r--test/yaml/empty-value-map-1/input.yaml3
-rw-r--r--test/yaml/empty-value-map-2/input.yaml3
-rw-r--r--test/yaml/empty-value-sequence-1/input.yaml2
-rw-r--r--test/yaml/empty-value-sequence-2/input.yaml3
-rw-r--r--test/yaml/invalids/1.yaml4
-rw-r--r--test/yaml/invalids/2.yaml4
-rw-r--r--test/yaml/invalids/3.yaml4
-rw-r--r--test/yaml/literal-block-1/input.yaml11
-rw-r--r--test/yaml/literal-block-2/input.yaml9
-rw-r--r--test/yaml/map-key-1/input.yaml5
-rw-r--r--test/yaml/multi-line-1/input.yaml4
-rw-r--r--test/yaml/multi-line-2/input.yaml5
-rw-r--r--test/yaml/null/input.yaml10
-rw-r--r--test/yaml/quoted-string/input.yaml22
-rw-r--r--test/yaml/swagger/input.yaml155
-rw-r--r--test/yaml/url/input.yaml7
20 files changed, 316 insertions, 0 deletions
diff --git a/test/yaml/basic1/input.yaml b/test/yaml/basic1/input.yaml
new file mode 100644
index 0000000..4ba06b4
--- /dev/null
+++ b/test/yaml/basic1/input.yaml
@@ -0,0 +1,19 @@
+# header comment.
+--- # start of document
+dict:
+ a: 1 # one
+ b: 2 # two
+ c:
+ - foo
+ - bar
+list:
+ - 1
+ - 2
+ -
+ a: 1.1
+ b: 1.2
+ c: 1.3
+
+number: 12.3
+string: foo
+
diff --git a/test/yaml/basic2/input.yaml b/test/yaml/basic2/input.yaml
new file mode 100644
index 0000000..ddc993a
--- /dev/null
+++ b/test/yaml/basic2/input.yaml
@@ -0,0 +1,6 @@
+# Missing document start marker '---'
+- 1
+-
+ 2
+-
+ 3
diff --git a/test/yaml/basic3/input.yaml b/test/yaml/basic3/input.yaml
new file mode 100644
index 0000000..ab3e3b1
--- /dev/null
+++ b/test/yaml/basic3/input.yaml
@@ -0,0 +1,7 @@
+---
+- a: 1
+ b: 2
+ c: 3
+- d: 4
+ e: 5
+ f: 6
diff --git a/test/yaml/boolean/input.yaml b/test/yaml/boolean/input.yaml
new file mode 100644
index 0000000..1afeeab
--- /dev/null
+++ b/test/yaml/boolean/input.yaml
@@ -0,0 +1,33 @@
+---
+positive:
+ - y
+ - Y
+ - yes
+ - Yes
+ - YES
+ - true
+ - True
+ - TRUE
+ - on
+ - On
+ - ON
+negative:
+ - n
+ - N
+ - no
+ - No
+ - NO
+ - false
+ - False
+ - FALSE
+ - off
+ - Off
+ - OFF
+non boolean:
+ - yES
+ - nO
+ - tRUE
+ - faLSE
+ - oN
+ - oFF
+
diff --git a/test/yaml/empty-value-map-1/input.yaml b/test/yaml/empty-value-map-1/input.yaml
new file mode 100644
index 0000000..6ae0793
--- /dev/null
+++ b/test/yaml/empty-value-map-1/input.yaml
@@ -0,0 +1,3 @@
+---
+key:
+
diff --git a/test/yaml/empty-value-map-2/input.yaml b/test/yaml/empty-value-map-2/input.yaml
new file mode 100644
index 0000000..abc4334
--- /dev/null
+++ b/test/yaml/empty-value-map-2/input.yaml
@@ -0,0 +1,3 @@
+---
+key1:
+key2:
diff --git a/test/yaml/empty-value-sequence-1/input.yaml b/test/yaml/empty-value-sequence-1/input.yaml
new file mode 100644
index 0000000..d55221c
--- /dev/null
+++ b/test/yaml/empty-value-sequence-1/input.yaml
@@ -0,0 +1,2 @@
+---
+- # empty sequence element should be interpreted as null.
diff --git a/test/yaml/empty-value-sequence-2/input.yaml b/test/yaml/empty-value-sequence-2/input.yaml
new file mode 100644
index 0000000..417173f
--- /dev/null
+++ b/test/yaml/empty-value-sequence-2/input.yaml
@@ -0,0 +1,3 @@
+--- # sequence with two empty elements which implicitly contain null values.
+-
+-
diff --git a/test/yaml/invalids/1.yaml b/test/yaml/invalids/1.yaml
new file mode 100644
index 0000000..3280620
--- /dev/null
+++ b/test/yaml/invalids/1.yaml
@@ -0,0 +1,4 @@
+---
+ a: # the first non-comment line should not be indented.
+b:
+
diff --git a/test/yaml/invalids/2.yaml b/test/yaml/invalids/2.yaml
new file mode 100644
index 0000000..fbe4023
--- /dev/null
+++ b/test/yaml/invalids/2.yaml
@@ -0,0 +1,4 @@
+---
+key:
+a # key is expected here but not found.
+
diff --git a/test/yaml/invalids/3.yaml b/test/yaml/invalids/3.yaml
new file mode 100644
index 0000000..cf14ffe
--- /dev/null
+++ b/test/yaml/invalids/3.yaml
@@ -0,0 +1,4 @@
+---
+- a
+c # sequence element is expected, but not found.
+- b
diff --git a/test/yaml/literal-block-1/input.yaml b/test/yaml/literal-block-1/input.yaml
new file mode 100644
index 0000000..38a7799
--- /dev/null
+++ b/test/yaml/literal-block-1/input.yaml
@@ -0,0 +1,11 @@
+# Multi-line string where line breaks need to be preserved.
+
+# When the line begins with '|', the next line needs to be indented, and all
+# the other lines thereafter need to have indent level greater than that of
+# the first line.
+--- |
+ line 1
+ line 2
+ line 3
+ 2 blanks follow
+
diff --git a/test/yaml/literal-block-2/input.yaml b/test/yaml/literal-block-2/input.yaml
new file mode 100644
index 0000000..a71fa09
--- /dev/null
+++ b/test/yaml/literal-block-2/input.yaml
@@ -0,0 +1,9 @@
+---
+literal block: | # line breaks and white spaces are preserved.
+ line 1
+ line 2
+ line 3
+multi line: # the lines are merged into "line 1 line 2 line 3"
+ line 1
+ line 2
+ line 3
diff --git a/test/yaml/map-key-1/input.yaml b/test/yaml/map-key-1/input.yaml
new file mode 100644
index 0000000..6778b52
--- /dev/null
+++ b/test/yaml/map-key-1/input.yaml
@@ -0,0 +1,5 @@
+-key: # this is a map key that starts with a '-'.
+ value
+key:
+ value
+
diff --git a/test/yaml/multi-line-1/input.yaml b/test/yaml/multi-line-1/input.yaml
new file mode 100644
index 0000000..824ed7b
--- /dev/null
+++ b/test/yaml/multi-line-1/input.yaml
@@ -0,0 +1,4 @@
+# This document contains one root value of "1 2 3".
+--- 1
+2
+3
diff --git a/test/yaml/multi-line-2/input.yaml b/test/yaml/multi-line-2/input.yaml
new file mode 100644
index 0000000..a382e66
--- /dev/null
+++ b/test/yaml/multi-line-2/input.yaml
@@ -0,0 +1,5 @@
+# Once a multi-line string starts, everything becomes part of it.
+# This document has only one root value that has a string value of "1 - 2 - 3".
+1
+- 2
+- 3
diff --git a/test/yaml/null/input.yaml b/test/yaml/null/input.yaml
new file mode 100644
index 0000000..56d68d3
--- /dev/null
+++ b/test/yaml/null/input.yaml
@@ -0,0 +1,10 @@
+--- # Handle null keywords.
+# These are all valid null values.
+- null
+- Null
+- NULL
+- ~
+# However, these are not null values but string values according to the spec.
+- nULL
+- NUll
+
diff --git a/test/yaml/quoted-string/input.yaml b/test/yaml/quoted-string/input.yaml
new file mode 100644
index 0000000..d2b50e5
--- /dev/null
+++ b/test/yaml/quoted-string/input.yaml
@@ -0,0 +1,22 @@
+---
+"I am quoted: ~ " : "Here is another quote."
+list with quoted string values :
+ - "1 2 3"
+ - "null"
+ - "true"
+ - "false"
+ - "#hashtag"
+ - "\"quoted inside\""
+ - "'single quote inside'"
+ - "Japan's finest beer"
+'single quoted string values' :
+ - '8.8.8.8'
+ - '''single quote inside'''
+ - 'prefix ''quoted'' suffix'
+ - '"double quote"'
+ - 'before "quote" after'
+ - 'http://www.google.com'
+ - '''''''' # equivalent of "'''"
+ - ' '' '' '' ' # equivalent of " ' ' ' "
+ - '#hashtag'
+
diff --git a/test/yaml/swagger/input.yaml b/test/yaml/swagger/input.yaml
new file mode 100644
index 0000000..3577bb0
--- /dev/null
+++ b/test/yaml/swagger/input.yaml
@@ -0,0 +1,155 @@
+swagger: '2.0'
+info:
+ version: '1.0.0'
+ title: Swagger Petstore (Simple)
+ description: A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification
+ termsOfService: http://helloreverb.com/terms/
+ contact:
+ name: Swagger API team
+ email: foo@example.com
+ url: http://swagger.io
+ license:
+ name: MIT
+ url: http://opensource.org/licenses/MIT
+host: petstore.swagger.wordnik.com
+basePath: /api
+schemes:
+ - http
+consumes:
+ - application/json
+produces:
+ - application/json
+paths:
+ /pets:
+ get:
+ description: Returns all pets from the system that the user has access to
+ operationId: findPets
+ produces:
+ - application/json
+ - application/xml
+ - text/xml
+ - text/html
+ parameters:
+ - name: tags
+ in: query
+ description: tags to filter by
+ required: false
+ type: array
+ items:
+ type: string
+ collectionFormat: csv
+ - name: limit
+ in: query
+ description: maximum number of results to return
+ required: false
+ type: integer
+ format: int32
+ responses:
+ '200':
+ description: pet response
+ schema:
+ type: array
+ items:
+ $ref: '#/definitions/pet'
+ default:
+ description: unexpected error
+ schema:
+ $ref: '#/definitions/errorModel'
+ post:
+ description: Creates a new pet in the store. Duplicates are allowed
+ operationId: addPet
+ produces:
+ - application/json
+ parameters:
+ - name: pet
+ in: body
+ description: Pet to add to the store
+ required: true
+ schema:
+ $ref: '#/definitions/newPet'
+ responses:
+ '200':
+ description: pet response
+ schema:
+ $ref: '#/definitions/pet'
+ default:
+ description: unexpected error
+ schema:
+ $ref: '#/definitions/errorModel'
+ /pets/{id}:
+ get:
+ description: Returns a user based on a single ID, if the user does not have access to the pet
+ operationId: findPetById
+ produces:
+ - application/json
+ - application/xml
+ - text/xml
+ - text/html
+ parameters:
+ - name: id
+ in: path
+ description: ID of pet to fetch
+ required: true
+ type: integer
+ format: int64
+ responses:
+ '200':
+ description: pet response
+ schema:
+ $ref: '#/definitions/pet'
+ default:
+ description: unexpected error
+ schema:
+ $ref: '#/definitions/errorModel'
+ delete:
+ description: deletes a single pet based on the ID supplied
+ operationId: deletePet
+ parameters:
+ - name: id
+ in: path
+ description: ID of pet to delete
+ required: true
+ type: integer
+ format: int64
+ responses:
+ '204':
+ description: pet deleted
+ default:
+ description: unexpected error
+ schema:
+ $ref: '#/definitions/errorModel'
+definitions:
+ pet:
+ required:
+ - id
+ - name
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ tag:
+ type: string
+ newPet:
+ required:
+ - name
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ tag:
+ type: string
+ errorModel:
+ required:
+ - code
+ - message
+ properties:
+ code:
+ type: integer
+ format: int32
+ message:
+ type: string
+
diff --git a/test/yaml/url/input.yaml b/test/yaml/url/input.yaml
new file mode 100644
index 0000000..7818ae0
--- /dev/null
+++ b/test/yaml/url/input.yaml
@@ -0,0 +1,7 @@
+---
+- http://www.google.com/
+- mailto:joe@joe-me.com
+- orcus-url:
+ http://gitlab.com/orcus/orcus
+ debian-bugs: mailto:submit@bugs.debian.org
+