From 431a379c815de74135b5584cc4745c05cdee2358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Verg=C3=A9?= Date: Tue, 19 Jan 2016 19:07:59 +0100 Subject: [PATCH] Tests: Add tests from YAML 1.2 specification Write all examples from http://www.yaml.org/spec/1.2/spec.html in independent files in tests/yaml-1.2-spec-examples; and test them with yamllint. --- tests/test_spec_examples.py | 187 ++++++++++++++++++++++ tests/yaml-1.2-spec-examples/example-10.1 | 6 + tests/yaml-1.2-spec-examples/example-10.2 | 6 + tests/yaml-1.2-spec-examples/example-10.3 | 4 + tests/yaml-1.2-spec-examples/example-10.4 | 2 + tests/yaml-1.2-spec-examples/example-10.5 | 2 + tests/yaml-1.2-spec-examples/example-10.6 | 3 + tests/yaml-1.2-spec-examples/example-10.7 | 5 + tests/yaml-1.2-spec-examples/example-10.8 | 5 + tests/yaml-1.2-spec-examples/example-10.9 | 7 + tests/yaml-1.2-spec-examples/example-2.1 | 3 + tests/yaml-1.2-spec-examples/example-2.10 | 8 + tests/yaml-1.2-spec-examples/example-2.11 | 9 ++ tests/yaml-1.2-spec-examples/example-2.12 | 9 ++ tests/yaml-1.2-spec-examples/example-2.13 | 4 + tests/yaml-1.2-spec-examples/example-2.14 | 4 + tests/yaml-1.2-spec-examples/example-2.15 | 8 + tests/yaml-1.2-spec-examples/example-2.16 | 8 + tests/yaml-1.2-spec-examples/example-2.17 | 7 + tests/yaml-1.2-spec-examples/example-2.18 | 7 + tests/yaml-1.2-spec-examples/example-2.19 | 5 + tests/yaml-1.2-spec-examples/example-2.2 | 3 + tests/yaml-1.2-spec-examples/example-2.20 | 5 + tests/yaml-1.2-spec-examples/example-2.21 | 3 + tests/yaml-1.2-spec-examples/example-2.22 | 4 + tests/yaml-1.2-spec-examples/example-2.23 | 14 ++ tests/yaml-1.2-spec-examples/example-2.24 | 14 ++ tests/yaml-1.2-spec-examples/example-2.25 | 7 + tests/yaml-1.2-spec-examples/example-2.26 | 7 + tests/yaml-1.2-spec-examples/example-2.27 | 29 ++++ tests/yaml-1.2-spec-examples/example-2.28 | 29 ++++ tests/yaml-1.2-spec-examples/example-2.3 | 8 + tests/yaml-1.2-spec-examples/example-2.4 | 8 + tests/yaml-1.2-spec-examples/example-2.5 | 5 + tests/yaml-1.2-spec-examples/example-2.6 | 5 + tests/yaml-1.2-spec-examples/example-2.7 | 10 ++ tests/yaml-1.2-spec-examples/example-2.8 | 10 ++ tests/yaml-1.2-spec-examples/example-2.9 | 8 + tests/yaml-1.2-spec-examples/example-5.1 | 1 + tests/yaml-1.2-spec-examples/example-5.10 | 2 + tests/yaml-1.2-spec-examples/example-5.11 | 3 + tests/yaml-1.2-spec-examples/example-5.12 | 6 + tests/yaml-1.2-spec-examples/example-5.13 | 5 + tests/yaml-1.2-spec-examples/example-5.14 | 3 + tests/yaml-1.2-spec-examples/example-5.2 | 3 + tests/yaml-1.2-spec-examples/example-5.3 | 7 + tests/yaml-1.2-spec-examples/example-5.4 | 2 + tests/yaml-1.2-spec-examples/example-5.5 | 1 + tests/yaml-1.2-spec-examples/example-5.6 | 2 + tests/yaml-1.2-spec-examples/example-5.7 | 6 + tests/yaml-1.2-spec-examples/example-5.8 | 2 + tests/yaml-1.2-spec-examples/example-5.9 | 2 + tests/yaml-1.2-spec-examples/example-6.1 | 12 ++ tests/yaml-1.2-spec-examples/example-6.10 | 3 + tests/yaml-1.2-spec-examples/example-6.11 | 4 + tests/yaml-1.2-spec-examples/example-6.12 | 6 + tests/yaml-1.2-spec-examples/example-6.13 | 3 + tests/yaml-1.2-spec-examples/example-6.14 | 4 + tests/yaml-1.2-spec-examples/example-6.15 | 3 + tests/yaml-1.2-spec-examples/example-6.16 | 3 + tests/yaml-1.2-spec-examples/example-6.17 | 3 + tests/yaml-1.2-spec-examples/example-6.18 | 7 + tests/yaml-1.2-spec-examples/example-6.19 | 3 + tests/yaml-1.2-spec-examples/example-6.2 | 4 + tests/yaml-1.2-spec-examples/example-6.20 | 3 + tests/yaml-1.2-spec-examples/example-6.21 | 7 + tests/yaml-1.2-spec-examples/example-6.22 | 3 + tests/yaml-1.2-spec-examples/example-6.23 | 3 + tests/yaml-1.2-spec-examples/example-6.24 | 2 + tests/yaml-1.2-spec-examples/example-6.25 | 2 + tests/yaml-1.2-spec-examples/example-6.26 | 5 + tests/yaml-1.2-spec-examples/example-6.27 | 4 + tests/yaml-1.2-spec-examples/example-6.28 | 4 + tests/yaml-1.2-spec-examples/example-6.29 | 2 + tests/yaml-1.2-spec-examples/example-6.3 | 3 + tests/yaml-1.2-spec-examples/example-6.4 | 7 + tests/yaml-1.2-spec-examples/example-6.5 | 7 + tests/yaml-1.2-spec-examples/example-6.6 | 7 + tests/yaml-1.2-spec-examples/example-6.7 | 6 + tests/yaml-1.2-spec-examples/example-6.8 | 7 + tests/yaml-1.2-spec-examples/example-6.9 | 2 + tests/yaml-1.2-spec-examples/example-7.1 | 4 + tests/yaml-1.2-spec-examples/example-7.10 | 12 ++ tests/yaml-1.2-spec-examples/example-7.11 | 3 + tests/yaml-1.2-spec-examples/example-7.12 | 4 + tests/yaml-1.2-spec-examples/example-7.13 | 2 + tests/yaml-1.2-spec-examples/example-7.14 | 8 + tests/yaml-1.2-spec-examples/example-7.15 | 2 + tests/yaml-1.2-spec-examples/example-7.16 | 5 + tests/yaml-1.2-spec-examples/example-7.17 | 6 + tests/yaml-1.2-spec-examples/example-7.18 | 5 + tests/yaml-1.2-spec-examples/example-7.19 | 3 + tests/yaml-1.2-spec-examples/example-7.2 | 4 + tests/yaml-1.2-spec-examples/example-7.20 | 4 + tests/yaml-1.2-spec-examples/example-7.21 | 3 + tests/yaml-1.2-spec-examples/example-7.22 | 3 + tests/yaml-1.2-spec-examples/example-7.23 | 5 + tests/yaml-1.2-spec-examples/example-7.24 | 5 + tests/yaml-1.2-spec-examples/example-7.3 | 4 + tests/yaml-1.2-spec-examples/example-7.4 | 3 + tests/yaml-1.2-spec-examples/example-7.5 | 5 + tests/yaml-1.2-spec-examples/example-7.6 | 4 + tests/yaml-1.2-spec-examples/example-7.7 | 1 + tests/yaml-1.2-spec-examples/example-7.8 | 3 + tests/yaml-1.2-spec-examples/example-7.9 | 4 + tests/yaml-1.2-spec-examples/example-8.1 | 10 ++ tests/yaml-1.2-spec-examples/example-8.10 | 16 ++ tests/yaml-1.2-spec-examples/example-8.11 | 16 ++ tests/yaml-1.2-spec-examples/example-8.12 | 16 ++ tests/yaml-1.2-spec-examples/example-8.13 | 15 ++ tests/yaml-1.2-spec-examples/example-8.14 | 3 + tests/yaml-1.2-spec-examples/example-8.15 | 6 + tests/yaml-1.2-spec-examples/example-8.16 | 2 + tests/yaml-1.2-spec-examples/example-8.17 | 5 + tests/yaml-1.2-spec-examples/example-8.18 | 4 + tests/yaml-1.2-spec-examples/example-8.19 | 3 + tests/yaml-1.2-spec-examples/example-8.2 | 11 ++ tests/yaml-1.2-spec-examples/example-8.20 | 6 + tests/yaml-1.2-spec-examples/example-8.21 | 6 + tests/yaml-1.2-spec-examples/example-8.22 | 6 + tests/yaml-1.2-spec-examples/example-8.3 | 8 + tests/yaml-1.2-spec-examples/example-8.4 | 6 + tests/yaml-1.2-spec-examples/example-8.5 | 19 +++ tests/yaml-1.2-spec-examples/example-8.6 | 6 + tests/yaml-1.2-spec-examples/example-8.7 | 4 + tests/yaml-1.2-spec-examples/example-8.8 | 9 ++ tests/yaml-1.2-spec-examples/example-8.9 | 4 + tests/yaml-1.2-spec-examples/example-9.1 | 3 + tests/yaml-1.2-spec-examples/example-9.2 | 4 + tests/yaml-1.2-spec-examples/example-9.3 | 7 + tests/yaml-1.2-spec-examples/example-9.4 | 7 + tests/yaml-1.2-spec-examples/example-9.5 | 8 + tests/yaml-1.2-spec-examples/example-9.6 | 7 + 133 files changed, 961 insertions(+) create mode 100644 tests/test_spec_examples.py create mode 100644 tests/yaml-1.2-spec-examples/example-10.1 create mode 100644 tests/yaml-1.2-spec-examples/example-10.2 create mode 100644 tests/yaml-1.2-spec-examples/example-10.3 create mode 100644 tests/yaml-1.2-spec-examples/example-10.4 create mode 100644 tests/yaml-1.2-spec-examples/example-10.5 create mode 100644 tests/yaml-1.2-spec-examples/example-10.6 create mode 100644 tests/yaml-1.2-spec-examples/example-10.7 create mode 100644 tests/yaml-1.2-spec-examples/example-10.8 create mode 100644 tests/yaml-1.2-spec-examples/example-10.9 create mode 100644 tests/yaml-1.2-spec-examples/example-2.1 create mode 100644 tests/yaml-1.2-spec-examples/example-2.10 create mode 100644 tests/yaml-1.2-spec-examples/example-2.11 create mode 100644 tests/yaml-1.2-spec-examples/example-2.12 create mode 100644 tests/yaml-1.2-spec-examples/example-2.13 create mode 100644 tests/yaml-1.2-spec-examples/example-2.14 create mode 100644 tests/yaml-1.2-spec-examples/example-2.15 create mode 100644 tests/yaml-1.2-spec-examples/example-2.16 create mode 100644 tests/yaml-1.2-spec-examples/example-2.17 create mode 100644 tests/yaml-1.2-spec-examples/example-2.18 create mode 100644 tests/yaml-1.2-spec-examples/example-2.19 create mode 100644 tests/yaml-1.2-spec-examples/example-2.2 create mode 100644 tests/yaml-1.2-spec-examples/example-2.20 create mode 100644 tests/yaml-1.2-spec-examples/example-2.21 create mode 100644 tests/yaml-1.2-spec-examples/example-2.22 create mode 100644 tests/yaml-1.2-spec-examples/example-2.23 create mode 100644 tests/yaml-1.2-spec-examples/example-2.24 create mode 100644 tests/yaml-1.2-spec-examples/example-2.25 create mode 100644 tests/yaml-1.2-spec-examples/example-2.26 create mode 100644 tests/yaml-1.2-spec-examples/example-2.27 create mode 100644 tests/yaml-1.2-spec-examples/example-2.28 create mode 100644 tests/yaml-1.2-spec-examples/example-2.3 create mode 100644 tests/yaml-1.2-spec-examples/example-2.4 create mode 100644 tests/yaml-1.2-spec-examples/example-2.5 create mode 100644 tests/yaml-1.2-spec-examples/example-2.6 create mode 100644 tests/yaml-1.2-spec-examples/example-2.7 create mode 100644 tests/yaml-1.2-spec-examples/example-2.8 create mode 100644 tests/yaml-1.2-spec-examples/example-2.9 create mode 100644 tests/yaml-1.2-spec-examples/example-5.1 create mode 100644 tests/yaml-1.2-spec-examples/example-5.10 create mode 100644 tests/yaml-1.2-spec-examples/example-5.11 create mode 100644 tests/yaml-1.2-spec-examples/example-5.12 create mode 100644 tests/yaml-1.2-spec-examples/example-5.13 create mode 100644 tests/yaml-1.2-spec-examples/example-5.14 create mode 100644 tests/yaml-1.2-spec-examples/example-5.2 create mode 100644 tests/yaml-1.2-spec-examples/example-5.3 create mode 100644 tests/yaml-1.2-spec-examples/example-5.4 create mode 100644 tests/yaml-1.2-spec-examples/example-5.5 create mode 100644 tests/yaml-1.2-spec-examples/example-5.6 create mode 100644 tests/yaml-1.2-spec-examples/example-5.7 create mode 100644 tests/yaml-1.2-spec-examples/example-5.8 create mode 100644 tests/yaml-1.2-spec-examples/example-5.9 create mode 100644 tests/yaml-1.2-spec-examples/example-6.1 create mode 100644 tests/yaml-1.2-spec-examples/example-6.10 create mode 100644 tests/yaml-1.2-spec-examples/example-6.11 create mode 100644 tests/yaml-1.2-spec-examples/example-6.12 create mode 100644 tests/yaml-1.2-spec-examples/example-6.13 create mode 100644 tests/yaml-1.2-spec-examples/example-6.14 create mode 100644 tests/yaml-1.2-spec-examples/example-6.15 create mode 100644 tests/yaml-1.2-spec-examples/example-6.16 create mode 100644 tests/yaml-1.2-spec-examples/example-6.17 create mode 100644 tests/yaml-1.2-spec-examples/example-6.18 create mode 100644 tests/yaml-1.2-spec-examples/example-6.19 create mode 100644 tests/yaml-1.2-spec-examples/example-6.2 create mode 100644 tests/yaml-1.2-spec-examples/example-6.20 create mode 100644 tests/yaml-1.2-spec-examples/example-6.21 create mode 100644 tests/yaml-1.2-spec-examples/example-6.22 create mode 100644 tests/yaml-1.2-spec-examples/example-6.23 create mode 100644 tests/yaml-1.2-spec-examples/example-6.24 create mode 100644 tests/yaml-1.2-spec-examples/example-6.25 create mode 100644 tests/yaml-1.2-spec-examples/example-6.26 create mode 100644 tests/yaml-1.2-spec-examples/example-6.27 create mode 100644 tests/yaml-1.2-spec-examples/example-6.28 create mode 100644 tests/yaml-1.2-spec-examples/example-6.29 create mode 100644 tests/yaml-1.2-spec-examples/example-6.3 create mode 100644 tests/yaml-1.2-spec-examples/example-6.4 create mode 100644 tests/yaml-1.2-spec-examples/example-6.5 create mode 100644 tests/yaml-1.2-spec-examples/example-6.6 create mode 100644 tests/yaml-1.2-spec-examples/example-6.7 create mode 100644 tests/yaml-1.2-spec-examples/example-6.8 create mode 100644 tests/yaml-1.2-spec-examples/example-6.9 create mode 100644 tests/yaml-1.2-spec-examples/example-7.1 create mode 100644 tests/yaml-1.2-spec-examples/example-7.10 create mode 100644 tests/yaml-1.2-spec-examples/example-7.11 create mode 100644 tests/yaml-1.2-spec-examples/example-7.12 create mode 100644 tests/yaml-1.2-spec-examples/example-7.13 create mode 100644 tests/yaml-1.2-spec-examples/example-7.14 create mode 100644 tests/yaml-1.2-spec-examples/example-7.15 create mode 100644 tests/yaml-1.2-spec-examples/example-7.16 create mode 100644 tests/yaml-1.2-spec-examples/example-7.17 create mode 100644 tests/yaml-1.2-spec-examples/example-7.18 create mode 100644 tests/yaml-1.2-spec-examples/example-7.19 create mode 100644 tests/yaml-1.2-spec-examples/example-7.2 create mode 100644 tests/yaml-1.2-spec-examples/example-7.20 create mode 100644 tests/yaml-1.2-spec-examples/example-7.21 create mode 100644 tests/yaml-1.2-spec-examples/example-7.22 create mode 100644 tests/yaml-1.2-spec-examples/example-7.23 create mode 100644 tests/yaml-1.2-spec-examples/example-7.24 create mode 100644 tests/yaml-1.2-spec-examples/example-7.3 create mode 100644 tests/yaml-1.2-spec-examples/example-7.4 create mode 100644 tests/yaml-1.2-spec-examples/example-7.5 create mode 100644 tests/yaml-1.2-spec-examples/example-7.6 create mode 100644 tests/yaml-1.2-spec-examples/example-7.7 create mode 100644 tests/yaml-1.2-spec-examples/example-7.8 create mode 100644 tests/yaml-1.2-spec-examples/example-7.9 create mode 100644 tests/yaml-1.2-spec-examples/example-8.1 create mode 100644 tests/yaml-1.2-spec-examples/example-8.10 create mode 100644 tests/yaml-1.2-spec-examples/example-8.11 create mode 100644 tests/yaml-1.2-spec-examples/example-8.12 create mode 100644 tests/yaml-1.2-spec-examples/example-8.13 create mode 100644 tests/yaml-1.2-spec-examples/example-8.14 create mode 100644 tests/yaml-1.2-spec-examples/example-8.15 create mode 100644 tests/yaml-1.2-spec-examples/example-8.16 create mode 100644 tests/yaml-1.2-spec-examples/example-8.17 create mode 100644 tests/yaml-1.2-spec-examples/example-8.18 create mode 100644 tests/yaml-1.2-spec-examples/example-8.19 create mode 100644 tests/yaml-1.2-spec-examples/example-8.2 create mode 100644 tests/yaml-1.2-spec-examples/example-8.20 create mode 100644 tests/yaml-1.2-spec-examples/example-8.21 create mode 100644 tests/yaml-1.2-spec-examples/example-8.22 create mode 100644 tests/yaml-1.2-spec-examples/example-8.3 create mode 100644 tests/yaml-1.2-spec-examples/example-8.4 create mode 100644 tests/yaml-1.2-spec-examples/example-8.5 create mode 100644 tests/yaml-1.2-spec-examples/example-8.6 create mode 100644 tests/yaml-1.2-spec-examples/example-8.7 create mode 100644 tests/yaml-1.2-spec-examples/example-8.8 create mode 100644 tests/yaml-1.2-spec-examples/example-8.9 create mode 100644 tests/yaml-1.2-spec-examples/example-9.1 create mode 100644 tests/yaml-1.2-spec-examples/example-9.2 create mode 100644 tests/yaml-1.2-spec-examples/example-9.3 create mode 100644 tests/yaml-1.2-spec-examples/example-9.4 create mode 100644 tests/yaml-1.2-spec-examples/example-9.5 create mode 100644 tests/yaml-1.2-spec-examples/example-9.6 diff --git a/tests/test_spec_examples.py b/tests/test_spec_examples.py new file mode 100644 index 0000000..6ec4d39 --- /dev/null +++ b/tests/test_spec_examples.py @@ -0,0 +1,187 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2016 Adrien Vergé +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import os + +from tests.common import RuleTestCase + + +# This file checks examples from YAML 1.2 specification [1] against yamllint. +# +# [1]: http://www.yaml.org/spec/1.2/spec.html +# +# Example files generated with: +# +# from bs4 import BeautifulSoup +# with open('spec.html', encoding='iso-8859-1') as f: +# soup = BeautifulSoup(f, 'lxml') +# for ex in soup.find_all('div', class_='example'): +# title = ex.find('p', class_='title').find('b').get_text() +# id = '-'.join(title.split('\xa0')[:2])[:-1].lower() +# span = ex.find('span', class_='database') +# for br in span.find_all("br"): +# br.replace_with("\n") +# text = text.replace('\u2193', '') # downwards arrow +# text = text.replace('\u00b7', ' ') # visible space +# text = text.replace('\u21d4', '') # byte order mark +# text = text.replace('\u2192', '\t') # right arrow +# text = text.replace('\u00b0', '') # empty scalar +# with open('tests/yaml-1.2-spec-examples/%s' % id, 'w', +# encoding='utf-8') as g: +# g.write(text) + +class SpecificationTestCase(RuleTestCase): + rule_id = None + +conf_general = ('document-start: disable\n' + 'comments: {min-spaces-from-content: 1}\n' + 'braces: {min-spaces-inside: 1, max-spaces-inside: 1}\n' + 'brackets: {min-spaces-inside: 1, max-spaces-inside: 1}\n') +conf_overrides = { + 'example-2.2': ('colons: {max-spaces-after: 2}\n'), + 'example-2.4': ('colons: {max-spaces-after: 3}\n'), + 'example-2.5': ('empty-lines: {max-end: 2}\n' + 'brackets: {min-spaces-inside: 0, max-spaces-inside: 2}\n' + 'commas: {max-spaces-before: -1}\n'), + 'example-2.6': ('braces: {min-spaces-inside: 0, max-spaces-inside: 0}\n' + 'indentation: disable\n'), + 'example-2.12': ('empty-lines: {max-end: 1}\n' + 'colons: {max-spaces-before: -1}\n'), + 'example-2.16': ('empty-lines: {max-end: 1}\n'), + 'example-2.18': ('empty-lines: {max-end: 1}\n'), + 'example-2.19': ('empty-lines: {max-end: 1}\n'), + 'example-2.28': ('empty-lines: {max-end: 3}\n'), + 'example-5.3': ('indentation: {indent-sequences: no}\n' + 'colons: {max-spaces-before: 1}\n'), + 'example-6.4': ('trailing-spaces: disable\n'), + 'example-6.5': ('trailing-spaces: disable\n'), + 'example-6.6': ('trailing-spaces: disable\n'), + 'example-6.7': ('trailing-spaces: disable\n'), + 'example-6.8': ('trailing-spaces: disable\n'), + 'example-6.10': ('empty-lines: {max-end: 2}\n' + 'trailing-spaces: disable\n' + 'comments-indentation: disable\n'), + 'example-6.11': ('empty-lines: {max-end: 1}\n' + 'comments-indentation: disable\n'), + 'example-6.13': ('comments-indentation: disable\n'), + 'example-6.14': ('comments-indentation: disable\n'), + 'example-6.23': ('colons: {max-spaces-before: 1}\n'), + 'example-7.4': ('colons: {max-spaces-before: 1}\n' + 'indentation: disable\n'), + 'example-7.5': ('trailing-spaces: disable\n'), + 'example-7.6': ('trailing-spaces: disable\n'), + 'example-7.7': ('indentation: disable\n'), + 'example-7.8': ('colons: {max-spaces-before: 1}\n' + 'indentation: disable\n'), + 'example-7.9': ('trailing-spaces: disable\n'), + 'example-7.11': ('colons: {max-spaces-before: 1}\n' + 'indentation: disable\n'), + 'example-7.13': ('brackets: {min-spaces-inside: 0, max-spaces-inside: 1}\n' + 'commas: {max-spaces-before: 1, min-spaces-after: 0}\n'), + 'example-7.14': ('indentation: disable\n'), + 'example-7.15': ('braces: {min-spaces-inside: 0, max-spaces-inside: 1}\n' + 'commas: {max-spaces-before: 1, min-spaces-after: 0}\n' + 'colons: {max-spaces-before: 1}\n'), + 'example-7.17': ('indentation: disable\n'), + 'example-7.18': ('indentation: disable\n'), + 'example-7.19': ('indentation: disable\n'), + 'example-7.20': ('colons: {max-spaces-before: 1}\n' + 'indentation: disable\n'), + 'example-8.1': ('empty-lines: {max-end: 1}\n'), + 'example-8.2': ('trailing-spaces: disable\n'), + 'example-8.5': ('comments-indentation: disable\n' + 'trailing-spaces: disable\n'), + 'example-8.6': ('empty-lines: {max-end: 1}\n'), + 'example-8.7': ('empty-lines: {max-end: 1}\n'), + 'example-8.8': ('trailing-spaces: disable\n'), + 'example-8.9': ('empty-lines: {max-end: 1}\n'), + 'example-8.14': ('colons: {max-spaces-before: 1}\n'), + 'example-8.16': ('indentation: {spaces: 1}\n'), +} + +files = os.listdir('tests/yaml-1.2-spec-examples') +assert len(files) == 132 + + +def _gen_test(buffer, conf): + def test(self): + self.check(buffer, conf) + return test + +# TODO +# The following tests are blacklisted because they contain rarely-used formats +# that yamllint does not handle yet. +tmp_blacklist = ( + 'example-2.25', + 'example-7.16', + 'example-8.17', + 'example-8.20', + 'example-8.22', + 'example-10.1', +) +# The following tests are blacklisted (i.e. will not be checked against +# yamllint), because pyyaml is currently not able to parse the contents +# (using yaml.parse()). +pyyaml_blacklist = ( + 'example-2.11', + 'example-2.23', + 'example-2.24', + 'example-2.27', + 'example-5.10', + 'example-5.12', + 'example-5.13', + 'example-5.14', + 'example-5.6', + 'example-6.1', + 'example-6.12', + 'example-6.15', + 'example-6.17', + 'example-6.18', + 'example-6.19', + 'example-6.2', + 'example-6.20', + 'example-6.21', + 'example-6.22', + 'example-6.24', + 'example-6.25', + 'example-6.26', + 'example-6.27', + 'example-6.3', + 'example-7.1', + 'example-7.10', + 'example-7.12', + 'example-7.17', + 'example-7.2', + 'example-7.21', + 'example-7.22', + 'example-7.3', + 'example-8.18', + 'example-8.19', + 'example-8.21', + 'example-8.3', + 'example-9.3', + 'example-9.4', + 'example-9.5', +) + +for file in files: + if file in tmp_blacklist or file in pyyaml_blacklist: + continue + + with open('tests/yaml-1.2-spec-examples/' + file) as f: + conf = conf_general + conf_overrides.get(file, '') + setattr(SpecificationTestCase, 'test_' + file, + _gen_test(f.read(), conf)) diff --git a/tests/yaml-1.2-spec-examples/example-10.1 b/tests/yaml-1.2-spec-examples/example-10.1 new file mode 100644 index 0000000..19c9782 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-10.1 @@ -0,0 +1,6 @@ +Block style: !!map + Clark : Evans + Ingy : döt Net + Oren : Ben-Kiki + +Flow style: !!map { Clark: Evans, Ingy: döt Net, Oren: Ben-Kiki } diff --git a/tests/yaml-1.2-spec-examples/example-10.2 b/tests/yaml-1.2-spec-examples/example-10.2 new file mode 100644 index 0000000..63899c3 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-10.2 @@ -0,0 +1,6 @@ +Block style: !!seq +- Clark Evans +- Ingy döt Net +- Oren Ben-Kiki + +Flow style: !!seq [ Clark Evans, Ingy döt Net, Oren Ben-Kiki ] diff --git a/tests/yaml-1.2-spec-examples/example-10.3 b/tests/yaml-1.2-spec-examples/example-10.3 new file mode 100644 index 0000000..50e83bc --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-10.3 @@ -0,0 +1,4 @@ +Block style: !!str |- + String: just a theory. + +Flow style: !!str "String: just a theory." diff --git a/tests/yaml-1.2-spec-examples/example-10.4 b/tests/yaml-1.2-spec-examples/example-10.4 new file mode 100644 index 0000000..7529872 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-10.4 @@ -0,0 +1,2 @@ +!!null null: value for null key +key with null value: !!null null diff --git a/tests/yaml-1.2-spec-examples/example-10.5 b/tests/yaml-1.2-spec-examples/example-10.5 new file mode 100644 index 0000000..2c11cad --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-10.5 @@ -0,0 +1,2 @@ +YAML is a superset of JSON: !!bool true +Pluto is a planet: !!bool false diff --git a/tests/yaml-1.2-spec-examples/example-10.6 b/tests/yaml-1.2-spec-examples/example-10.6 new file mode 100644 index 0000000..79fceea --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-10.6 @@ -0,0 +1,3 @@ +negative: !!int -12 +zero: !!int 0 +positive: !!int 34 diff --git a/tests/yaml-1.2-spec-examples/example-10.7 b/tests/yaml-1.2-spec-examples/example-10.7 new file mode 100644 index 0000000..f924530 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-10.7 @@ -0,0 +1,5 @@ +negative: !!float -1 +zero: !!float 0 +positive: !!float 2.3e4 +infinity: !!float .inf +not a number: !!float .nan diff --git a/tests/yaml-1.2-spec-examples/example-10.8 b/tests/yaml-1.2-spec-examples/example-10.8 new file mode 100644 index 0000000..552ff82 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-10.8 @@ -0,0 +1,5 @@ +A null: null +Booleans: [ true, false ] +Integers: [ 0, -0, 3, -19 ] +Floats: [ 0., -0.0, 12e03, -2E+05 ] +Invalid: [ True, Null, 0o7, 0x3A, +12.3 ] diff --git a/tests/yaml-1.2-spec-examples/example-10.9 b/tests/yaml-1.2-spec-examples/example-10.9 new file mode 100644 index 0000000..28b8111 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-10.9 @@ -0,0 +1,7 @@ +A null: null +Also a null: # Empty +Not a null: "" +Booleans: [ true, True, false, FALSE ] +Integers: [ 0, 0o7, 0x3A, -19 ] +Floats: [ 0., -0.0, .5, +12e03, -2E+05 ] +Also floats: [ .inf, -.Inf, +.INF, .NAN ] diff --git a/tests/yaml-1.2-spec-examples/example-2.1 b/tests/yaml-1.2-spec-examples/example-2.1 new file mode 100644 index 0000000..d12e671 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.1 @@ -0,0 +1,3 @@ +- Mark McGwire +- Sammy Sosa +- Ken Griffey diff --git a/tests/yaml-1.2-spec-examples/example-2.10 b/tests/yaml-1.2-spec-examples/example-2.10 new file mode 100644 index 0000000..61808f6 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.10 @@ -0,0 +1,8 @@ +--- +hr: + - Mark McGwire + # Following node labeled SS + - &SS Sammy Sosa +rbi: + - *SS # Subsequent occurrence + - Ken Griffey diff --git a/tests/yaml-1.2-spec-examples/example-2.11 b/tests/yaml-1.2-spec-examples/example-2.11 new file mode 100644 index 0000000..9123ce2 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.11 @@ -0,0 +1,9 @@ +? - Detroit Tigers + - Chicago cubs +: + - 2001-07-23 + +? [ New York Yankees, + Atlanta Braves ] +: [ 2001-07-02, 2001-08-12, + 2001-08-14 ] diff --git a/tests/yaml-1.2-spec-examples/example-2.12 b/tests/yaml-1.2-spec-examples/example-2.12 new file mode 100644 index 0000000..8125296 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.12 @@ -0,0 +1,9 @@ +--- +# Products purchased +- item : Super Hoop + quantity: 1 +- item : Basketball + quantity: 4 +- item : Big Shoes + quantity: 1 + diff --git a/tests/yaml-1.2-spec-examples/example-2.13 b/tests/yaml-1.2-spec-examples/example-2.13 new file mode 100644 index 0000000..13fb656 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.13 @@ -0,0 +1,4 @@ +# ASCII Art +--- | + \//||\/|| + // || ||__ diff --git a/tests/yaml-1.2-spec-examples/example-2.14 b/tests/yaml-1.2-spec-examples/example-2.14 new file mode 100644 index 0000000..fb4ed4a --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.14 @@ -0,0 +1,4 @@ +--- > + Mark McGwire's + year was crippled + by a knee injury. diff --git a/tests/yaml-1.2-spec-examples/example-2.15 b/tests/yaml-1.2-spec-examples/example-2.15 new file mode 100644 index 0000000..80b89a6 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.15 @@ -0,0 +1,8 @@ +> + Sammy Sosa completed another + fine season with great stats. + + 63 Home Runs + 0.288 Batting Average + + What a year! diff --git a/tests/yaml-1.2-spec-examples/example-2.16 b/tests/yaml-1.2-spec-examples/example-2.16 new file mode 100644 index 0000000..223ec81 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.16 @@ -0,0 +1,8 @@ +name: Mark McGwire +accomplishment: > + Mark set a major league + home run record in 1998. +stats: | + 65 Home Runs + 0.278 Batting Average + diff --git a/tests/yaml-1.2-spec-examples/example-2.17 b/tests/yaml-1.2-spec-examples/example-2.17 new file mode 100644 index 0000000..c5c2a18 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.17 @@ -0,0 +1,7 @@ +unicode: "Sosa did fine.\u263A" +control: "\b1998\t1999\t2000\n" +hex esc: "\x0d\x0a is \r\n" + +single: '"Howdy!" he cried.' +quoted: ' # Not a ''comment''.' +tie-fighter: '|\-*-/|' diff --git a/tests/yaml-1.2-spec-examples/example-2.18 b/tests/yaml-1.2-spec-examples/example-2.18 new file mode 100644 index 0000000..0f49d9c --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.18 @@ -0,0 +1,7 @@ +plain: + This unquoted scalar + spans many lines. + +quoted: "So does this + quoted scalar.\n" + diff --git a/tests/yaml-1.2-spec-examples/example-2.19 b/tests/yaml-1.2-spec-examples/example-2.19 new file mode 100644 index 0000000..843b149 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.19 @@ -0,0 +1,5 @@ +canonical: 12345 +decimal: +12345 +octal: 0o14 +hexadecimal: 0xC + diff --git a/tests/yaml-1.2-spec-examples/example-2.2 b/tests/yaml-1.2-spec-examples/example-2.2 new file mode 100644 index 0000000..7b7ec94 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.2 @@ -0,0 +1,3 @@ +hr: 65 # Home runs +avg: 0.278 # Batting average +rbi: 147 # Runs Batted In diff --git a/tests/yaml-1.2-spec-examples/example-2.20 b/tests/yaml-1.2-spec-examples/example-2.20 new file mode 100644 index 0000000..499cbb1 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.20 @@ -0,0 +1,5 @@ +canonical: 1.23015e+3 +exponential: 12.3015e+02 +fixed: 1230.15 +negative infinity: -.inf +not a number: .NaN diff --git a/tests/yaml-1.2-spec-examples/example-2.21 b/tests/yaml-1.2-spec-examples/example-2.21 new file mode 100644 index 0000000..510165d --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.21 @@ -0,0 +1,3 @@ +null: +booleans: [ true, false ] +string: '012345' diff --git a/tests/yaml-1.2-spec-examples/example-2.22 b/tests/yaml-1.2-spec-examples/example-2.22 new file mode 100644 index 0000000..aaac185 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.22 @@ -0,0 +1,4 @@ +canonical: 2001-12-15T02:59:43.1Z +iso8601: 2001-12-14t21:59:43.10-05:00 +spaced: 2001-12-14 21:59:43.10 -5 +date: 2002-12-14 diff --git a/tests/yaml-1.2-spec-examples/example-2.23 b/tests/yaml-1.2-spec-examples/example-2.23 new file mode 100644 index 0000000..de1a732 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.23 @@ -0,0 +1,14 @@ +--- +not-date: !!str 2002-04-28 + +picture: !!binary | + R0lGODlhDAAMAIQAAP//9/X + 17unp5WZmZgAAAOfn515eXv + Pz7Y6OjuDg4J+fn5OTk6enp + 56enmleECcgggoBADs= + +application specific tag: !something | + The semantics of the tag + above may be different for + different documents. + diff --git a/tests/yaml-1.2-spec-examples/example-2.24 b/tests/yaml-1.2-spec-examples/example-2.24 new file mode 100644 index 0000000..1180757 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.24 @@ -0,0 +1,14 @@ +%TAG ! tag:clarkevans.com,2002: +--- !shape + # Use the ! handle for presenting + # tag:clarkevans.com,2002:circle +- !circle + center: &ORIGIN {x: 73, y: 129} + radius: 7 +- !line + start: *ORIGIN + finish: { x: 89, y: 102 } +- !label + start: *ORIGIN + color: 0xFFEEBB + text: Pretty vector drawing. diff --git a/tests/yaml-1.2-spec-examples/example-2.25 b/tests/yaml-1.2-spec-examples/example-2.25 new file mode 100644 index 0000000..cf4943a --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.25 @@ -0,0 +1,7 @@ +# Sets are represented as a +# Mapping where each key is +# associated with a null value +--- !!set +? Mark McGwire +? Sammy Sosa +? Ken Griff diff --git a/tests/yaml-1.2-spec-examples/example-2.26 b/tests/yaml-1.2-spec-examples/example-2.26 new file mode 100644 index 0000000..a28a7ac --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.26 @@ -0,0 +1,7 @@ +# Ordered maps are represented as +# A sequence of mappings, with +# each mapping having one key +--- !!omap +- Mark McGwire: 65 +- Sammy Sosa: 63 +- Ken Griffy: 58 diff --git a/tests/yaml-1.2-spec-examples/example-2.27 b/tests/yaml-1.2-spec-examples/example-2.27 new file mode 100644 index 0000000..4625739 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.27 @@ -0,0 +1,29 @@ +--- ! +invoice: 34843 +date : 2001-01-23 +bill-to: &id001 + given : Chris + family : Dumars + address: + lines: | + 458 Walkman Dr. + Suite #292 + city : Royal Oak + state : MI + postal : 48046 +ship-to: *id001 +product: + - sku : BL394D + quantity : 4 + description : Basketball + price : 450.00 + - sku : BL4438H + quantity : 1 + description : Super Hoop + price : 2392.00 +tax : 251.42 +total: 4443.52 +comments: + Late afternoon is best. + Backup contact is Nancy + Billsmer @ 338-4338. diff --git a/tests/yaml-1.2-spec-examples/example-2.28 b/tests/yaml-1.2-spec-examples/example-2.28 new file mode 100644 index 0000000..eb5fb8a --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.28 @@ -0,0 +1,29 @@ +--- +Time: 2001-11-23 15:01:42 -5 +User: ed +Warning: + This is an error message + for the log file +--- +Time: 2001-11-23 15:02:31 -5 +User: ed +Warning: + A slightly different error + message. +--- +Date: 2001-11-23 15:03:17 -5 +User: ed +Fatal: + Unknown variable "bar" +Stack: + - file: TopClass.py + line: 23 + code: | + x = MoreObject("345\n") + - file: MoreClass.py + line: 58 + code: |- + foo = bar + + + diff --git a/tests/yaml-1.2-spec-examples/example-2.3 b/tests/yaml-1.2-spec-examples/example-2.3 new file mode 100644 index 0000000..656d628 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.3 @@ -0,0 +1,8 @@ +american: + - Boston Red Sox + - Detroit Tigers + - New York Yankees +national: + - New York Mets + - Chicago Cubs + - Atlanta Braves diff --git a/tests/yaml-1.2-spec-examples/example-2.4 b/tests/yaml-1.2-spec-examples/example-2.4 new file mode 100644 index 0000000..430f6b3 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.4 @@ -0,0 +1,8 @@ +- + name: Mark McGwire + hr: 65 + avg: 0.278 +- + name: Sammy Sosa + hr: 63 + avg: 0.288 diff --git a/tests/yaml-1.2-spec-examples/example-2.5 b/tests/yaml-1.2-spec-examples/example-2.5 new file mode 100644 index 0000000..9aafb4e --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.5 @@ -0,0 +1,5 @@ +- [name , hr, avg ] +- [Mark McGwire, 65, 0.278] +- [Sammy Sosa , 63, 0.288] + + diff --git a/tests/yaml-1.2-spec-examples/example-2.6 b/tests/yaml-1.2-spec-examples/example-2.6 new file mode 100644 index 0000000..7a957b2 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.6 @@ -0,0 +1,5 @@ +Mark McGwire: {hr: 65, avg: 0.278} +Sammy Sosa: { + hr: 63, + avg: 0.288 + } diff --git a/tests/yaml-1.2-spec-examples/example-2.7 b/tests/yaml-1.2-spec-examples/example-2.7 new file mode 100644 index 0000000..bc711d5 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.7 @@ -0,0 +1,10 @@ +# Ranking of 1998 home runs +--- +- Mark McGwire +- Sammy Sosa +- Ken Griffey + +# Team ranking +--- +- Chicago Cubs +- St Louis Cardinals diff --git a/tests/yaml-1.2-spec-examples/example-2.8 b/tests/yaml-1.2-spec-examples/example-2.8 new file mode 100644 index 0000000..05e102d --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.8 @@ -0,0 +1,10 @@ +--- +time: 20:03:20 +player: Sammy Sosa +action: strike (miss) +... +--- +time: 20:03:47 +player: Sammy Sosa +action: grand slam +... diff --git a/tests/yaml-1.2-spec-examples/example-2.9 b/tests/yaml-1.2-spec-examples/example-2.9 new file mode 100644 index 0000000..e264180 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-2.9 @@ -0,0 +1,8 @@ +--- +hr: # 1998 hr ranking + - Mark McGwire + - Sammy Sosa +rbi: + # 1998 rbi ranking + - Sammy Sosa + - Ken Griffey diff --git a/tests/yaml-1.2-spec-examples/example-5.1 b/tests/yaml-1.2-spec-examples/example-5.1 new file mode 100644 index 0000000..62524c0 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-5.1 @@ -0,0 +1 @@ +# Comment only. diff --git a/tests/yaml-1.2-spec-examples/example-5.10 b/tests/yaml-1.2-spec-examples/example-5.10 new file mode 100644 index 0000000..a4caf91 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-5.10 @@ -0,0 +1,2 @@ +commercial-at: @text +grave-accent: `text diff --git a/tests/yaml-1.2-spec-examples/example-5.11 b/tests/yaml-1.2-spec-examples/example-5.11 new file mode 100644 index 0000000..f980428 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-5.11 @@ -0,0 +1,3 @@ +| + Line break (no glyph) + Line break (glyphed) diff --git a/tests/yaml-1.2-spec-examples/example-5.12 b/tests/yaml-1.2-spec-examples/example-5.12 new file mode 100644 index 0000000..af9a321 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-5.12 @@ -0,0 +1,6 @@ +# Tabs and spaces +quoted: "Quoted " +block: | + void main() { + printf("Hello, world!\n"); + } diff --git a/tests/yaml-1.2-spec-examples/example-5.13 b/tests/yaml-1.2-spec-examples/example-5.13 new file mode 100644 index 0000000..a8f1b48 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-5.13 @@ -0,0 +1,5 @@ +"Fun with \\ +\" \a \b \e \f \ +\n \r \t \v \0 \ +\  \_ \N \L \P \ +\x41 \u0041 \U00000041" diff --git a/tests/yaml-1.2-spec-examples/example-5.14 b/tests/yaml-1.2-spec-examples/example-5.14 new file mode 100644 index 0000000..7bf12b6 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-5.14 @@ -0,0 +1,3 @@ +Bad escapes: + "\c + \xq-" diff --git a/tests/yaml-1.2-spec-examples/example-5.2 b/tests/yaml-1.2-spec-examples/example-5.2 new file mode 100644 index 0000000..9f1ca25 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-5.2 @@ -0,0 +1,3 @@ +- Invalid use of BOM + +- Inside a document. diff --git a/tests/yaml-1.2-spec-examples/example-5.3 b/tests/yaml-1.2-spec-examples/example-5.3 new file mode 100644 index 0000000..608ea19 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-5.3 @@ -0,0 +1,7 @@ +sequence: +- one +- two +mapping: + ? sky + : blue + sea : green diff --git a/tests/yaml-1.2-spec-examples/example-5.4 b/tests/yaml-1.2-spec-examples/example-5.4 new file mode 100644 index 0000000..df33847 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-5.4 @@ -0,0 +1,2 @@ +sequence: [ one, two, ] +mapping: { sky: blue, sea: green } diff --git a/tests/yaml-1.2-spec-examples/example-5.5 b/tests/yaml-1.2-spec-examples/example-5.5 new file mode 100644 index 0000000..62524c0 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-5.5 @@ -0,0 +1 @@ +# Comment only. diff --git a/tests/yaml-1.2-spec-examples/example-5.6 b/tests/yaml-1.2-spec-examples/example-5.6 new file mode 100644 index 0000000..7a1f9b3 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-5.6 @@ -0,0 +1,2 @@ +anchored: !local &anchor value +alias: *anchor diff --git a/tests/yaml-1.2-spec-examples/example-5.7 b/tests/yaml-1.2-spec-examples/example-5.7 new file mode 100644 index 0000000..934726c --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-5.7 @@ -0,0 +1,6 @@ +literal: | + some + text +folded: > + some + text diff --git a/tests/yaml-1.2-spec-examples/example-5.8 b/tests/yaml-1.2-spec-examples/example-5.8 new file mode 100644 index 0000000..04ebf69 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-5.8 @@ -0,0 +1,2 @@ +single: 'text' +double: "text" diff --git a/tests/yaml-1.2-spec-examples/example-5.9 b/tests/yaml-1.2-spec-examples/example-5.9 new file mode 100644 index 0000000..62204de --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-5.9 @@ -0,0 +1,2 @@ +%YAML 1.2 +--- text diff --git a/tests/yaml-1.2-spec-examples/example-6.1 b/tests/yaml-1.2-spec-examples/example-6.1 new file mode 100644 index 0000000..b5496c1 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.1 @@ -0,0 +1,12 @@ + # Leading comment line spaces are + # neither content nor indentation. + +Not indented: + By one space: | + By four + spaces + Flow style: [ # Leading spaces + By two, # in flow style + Also by two, # are neither + Still by two # content nor + ] # indentation. diff --git a/tests/yaml-1.2-spec-examples/example-6.10 b/tests/yaml-1.2-spec-examples/example-6.10 new file mode 100644 index 0000000..ff741e5 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.10 @@ -0,0 +1,3 @@ + # Comment + + diff --git a/tests/yaml-1.2-spec-examples/example-6.11 b/tests/yaml-1.2-spec-examples/example-6.11 new file mode 100644 index 0000000..86308dd --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.11 @@ -0,0 +1,4 @@ +key: # Comment + # lines + value + diff --git a/tests/yaml-1.2-spec-examples/example-6.12 b/tests/yaml-1.2-spec-examples/example-6.12 new file mode 100644 index 0000000..e1e1113 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.12 @@ -0,0 +1,6 @@ +{ first: Sammy, last: Sosa }: +# Statistics: + hr: # Home runs + 65 + avg: # Average + 0.278 diff --git a/tests/yaml-1.2-spec-examples/example-6.13 b/tests/yaml-1.2-spec-examples/example-6.13 new file mode 100644 index 0000000..2113eb6 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.13 @@ -0,0 +1,3 @@ +%FOO bar baz # Should be ignored + # with a warning. +--- "foo" diff --git a/tests/yaml-1.2-spec-examples/example-6.14 b/tests/yaml-1.2-spec-examples/example-6.14 new file mode 100644 index 0000000..ef326d5 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.14 @@ -0,0 +1,4 @@ +%YAML 1.3 # Attempt parsing + # with a warning +--- +"foo" diff --git a/tests/yaml-1.2-spec-examples/example-6.15 b/tests/yaml-1.2-spec-examples/example-6.15 new file mode 100644 index 0000000..acff4e8 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.15 @@ -0,0 +1,3 @@ +%YAML 1.2 +%YAML 1.1 +foo diff --git a/tests/yaml-1.2-spec-examples/example-6.16 b/tests/yaml-1.2-spec-examples/example-6.16 new file mode 100644 index 0000000..50f5ab9 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.16 @@ -0,0 +1,3 @@ +%TAG !yaml! tag:yaml.org,2002: +--- +!yaml!str "foo" diff --git a/tests/yaml-1.2-spec-examples/example-6.17 b/tests/yaml-1.2-spec-examples/example-6.17 new file mode 100644 index 0000000..7276eae --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.17 @@ -0,0 +1,3 @@ +%TAG ! !foo +%TAG ! !foo +bar diff --git a/tests/yaml-1.2-spec-examples/example-6.18 b/tests/yaml-1.2-spec-examples/example-6.18 new file mode 100644 index 0000000..d79f04e --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.18 @@ -0,0 +1,7 @@ +# Private +!foo "bar" +... +# Global +%TAG ! tag:example.com,2000:app/ +--- +!foo "bar" diff --git a/tests/yaml-1.2-spec-examples/example-6.19 b/tests/yaml-1.2-spec-examples/example-6.19 new file mode 100644 index 0000000..7b9d9b1 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.19 @@ -0,0 +1,3 @@ +%TAG !! tag:example.com,2000:app/ +--- +!!int 1 - 3 # Interval, not integer diff --git a/tests/yaml-1.2-spec-examples/example-6.2 b/tests/yaml-1.2-spec-examples/example-6.2 new file mode 100644 index 0000000..ac0d970 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.2 @@ -0,0 +1,4 @@ +? a +: - b + - - c + - d diff --git a/tests/yaml-1.2-spec-examples/example-6.20 b/tests/yaml-1.2-spec-examples/example-6.20 new file mode 100644 index 0000000..690f138 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.20 @@ -0,0 +1,3 @@ +%TAG !e! tag:example.com,2000:app/ +--- +!e!foo "bar" diff --git a/tests/yaml-1.2-spec-examples/example-6.21 b/tests/yaml-1.2-spec-examples/example-6.21 new file mode 100644 index 0000000..57315a5 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.21 @@ -0,0 +1,7 @@ +%TAG !m! !my- +--- # Bulb here +!m!light fluorescent +... +%TAG !m! !my- +--- # Color here +!m!light green diff --git a/tests/yaml-1.2-spec-examples/example-6.22 b/tests/yaml-1.2-spec-examples/example-6.22 new file mode 100644 index 0000000..eedfe04 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.22 @@ -0,0 +1,3 @@ +%TAG !e! tag:example.com,2000:app/ +--- +- !e!foo "bar" diff --git a/tests/yaml-1.2-spec-examples/example-6.23 b/tests/yaml-1.2-spec-examples/example-6.23 new file mode 100644 index 0000000..66d75f3 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.23 @@ -0,0 +1,3 @@ +!!str &a1 "foo": + !!str bar +&a2 baz : *a1 diff --git a/tests/yaml-1.2-spec-examples/example-6.24 b/tests/yaml-1.2-spec-examples/example-6.24 new file mode 100644 index 0000000..8e51f52 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.24 @@ -0,0 +1,2 @@ +! foo : + ! baz diff --git a/tests/yaml-1.2-spec-examples/example-6.25 b/tests/yaml-1.2-spec-examples/example-6.25 new file mode 100644 index 0000000..f7d1b01 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.25 @@ -0,0 +1,2 @@ +- ! foo +- !<$:?> bar diff --git a/tests/yaml-1.2-spec-examples/example-6.26 b/tests/yaml-1.2-spec-examples/example-6.26 new file mode 100644 index 0000000..70365f4 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.26 @@ -0,0 +1,5 @@ +%TAG !e! tag:example.com,2000:app/ +--- +- !local foo +- !!str bar +- !e!tag%21 baz diff --git a/tests/yaml-1.2-spec-examples/example-6.27 b/tests/yaml-1.2-spec-examples/example-6.27 new file mode 100644 index 0000000..d7fff4e --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.27 @@ -0,0 +1,4 @@ +%TAG !e! tag:example,2000:app/ +--- +- !e! foo +- !h!bar baz diff --git a/tests/yaml-1.2-spec-examples/example-6.28 b/tests/yaml-1.2-spec-examples/example-6.28 new file mode 100644 index 0000000..98aa565 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.28 @@ -0,0 +1,4 @@ +# Assuming conventional resolution: +- "12" +- 12 +- ! 12 diff --git a/tests/yaml-1.2-spec-examples/example-6.29 b/tests/yaml-1.2-spec-examples/example-6.29 new file mode 100644 index 0000000..600d179 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.29 @@ -0,0 +1,2 @@ +First occurrence: &anchor Value +Second occurrence: *anchor diff --git a/tests/yaml-1.2-spec-examples/example-6.3 b/tests/yaml-1.2-spec-examples/example-6.3 new file mode 100644 index 0000000..5f48cf4 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.3 @@ -0,0 +1,3 @@ +- foo: bar +- - baz + - baz diff --git a/tests/yaml-1.2-spec-examples/example-6.4 b/tests/yaml-1.2-spec-examples/example-6.4 new file mode 100644 index 0000000..2f62d08 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.4 @@ -0,0 +1,7 @@ +plain: text + lines +quoted: "text + lines" +block: | + text + lines diff --git a/tests/yaml-1.2-spec-examples/example-6.5 b/tests/yaml-1.2-spec-examples/example-6.5 new file mode 100644 index 0000000..8ea3e52 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.5 @@ -0,0 +1,7 @@ +Folding: + "Empty line + + as a line feed" +Chomping: | + Clipped empty lines + diff --git a/tests/yaml-1.2-spec-examples/example-6.6 b/tests/yaml-1.2-spec-examples/example-6.6 new file mode 100644 index 0000000..1c5090d --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.6 @@ -0,0 +1,7 @@ +>- + trimmed + + + + as + space diff --git a/tests/yaml-1.2-spec-examples/example-6.7 b/tests/yaml-1.2-spec-examples/example-6.7 new file mode 100644 index 0000000..0896cc6 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.7 @@ -0,0 +1,6 @@ +> + foo + + bar + + baz diff --git a/tests/yaml-1.2-spec-examples/example-6.8 b/tests/yaml-1.2-spec-examples/example-6.8 new file mode 100644 index 0000000..d6af812 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.8 @@ -0,0 +1,7 @@ +" + foo + + bar + + baz +" diff --git a/tests/yaml-1.2-spec-examples/example-6.9 b/tests/yaml-1.2-spec-examples/example-6.9 new file mode 100644 index 0000000..9a94fc1 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-6.9 @@ -0,0 +1,2 @@ +key: # Comment + valueeof diff --git a/tests/yaml-1.2-spec-examples/example-7.1 b/tests/yaml-1.2-spec-examples/example-7.1 new file mode 100644 index 0000000..3887676 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.1 @@ -0,0 +1,4 @@ +First occurrence: &anchor Foo +Second occurrence: *anchor +Override anchor: &anchor Bar +Reuse anchor: *anchor diff --git a/tests/yaml-1.2-spec-examples/example-7.10 b/tests/yaml-1.2-spec-examples/example-7.10 new file mode 100644 index 0000000..7ed369f --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.10 @@ -0,0 +1,12 @@ +# Outside flow collection: +- ::vector +- ": - ()" +- Up, up, and away! +- -123 +- http://example.com/foo#bar +# Inside flow collection: +- [ ::vector, + ": - ()", + "Up, up and away!", + -123, + http://example.com/foo#bar ] diff --git a/tests/yaml-1.2-spec-examples/example-7.11 b/tests/yaml-1.2-spec-examples/example-7.11 new file mode 100644 index 0000000..fd57f65 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.11 @@ -0,0 +1,3 @@ +implicit block key : [ + implicit flow key : value, + ] diff --git a/tests/yaml-1.2-spec-examples/example-7.12 b/tests/yaml-1.2-spec-examples/example-7.12 new file mode 100644 index 0000000..0499250 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.12 @@ -0,0 +1,4 @@ +1st non-empty + + 2nd non-empty + 3rd non-empty diff --git a/tests/yaml-1.2-spec-examples/example-7.13 b/tests/yaml-1.2-spec-examples/example-7.13 new file mode 100644 index 0000000..cd77480 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.13 @@ -0,0 +1,2 @@ +- [ one, two, ] +- [three ,four] diff --git a/tests/yaml-1.2-spec-examples/example-7.14 b/tests/yaml-1.2-spec-examples/example-7.14 new file mode 100644 index 0000000..6327116 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.14 @@ -0,0 +1,8 @@ +[ +"double + quoted", 'single + quoted', +plain + text, [ nested ], +single: pair, +] diff --git a/tests/yaml-1.2-spec-examples/example-7.15 b/tests/yaml-1.2-spec-examples/example-7.15 new file mode 100644 index 0000000..0718643 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.15 @@ -0,0 +1,2 @@ +- { one : two , three: four , } +- {five: six,seven : eight} diff --git a/tests/yaml-1.2-spec-examples/example-7.16 b/tests/yaml-1.2-spec-examples/example-7.16 new file mode 100644 index 0000000..cb84a99 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.16 @@ -0,0 +1,5 @@ +{ +? explicit: entry, +implicit: entry, +? +} diff --git a/tests/yaml-1.2-spec-examples/example-7.17 b/tests/yaml-1.2-spec-examples/example-7.17 new file mode 100644 index 0000000..3cc1296 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.17 @@ -0,0 +1,6 @@ +{ +unquoted : "separate", +http://foo.com, +omitted value:, +: omitted key, +} diff --git a/tests/yaml-1.2-spec-examples/example-7.18 b/tests/yaml-1.2-spec-examples/example-7.18 new file mode 100644 index 0000000..7fc069c --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.18 @@ -0,0 +1,5 @@ +{ +"adjacent":value, +"readable": value, +"empty": +} diff --git a/tests/yaml-1.2-spec-examples/example-7.19 b/tests/yaml-1.2-spec-examples/example-7.19 new file mode 100644 index 0000000..77f3eb3 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.19 @@ -0,0 +1,3 @@ +[ +foo: bar +] diff --git a/tests/yaml-1.2-spec-examples/example-7.2 b/tests/yaml-1.2-spec-examples/example-7.2 new file mode 100644 index 0000000..aa86103 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.2 @@ -0,0 +1,4 @@ +{ + foo : !!str, + !!str : bar, +} diff --git a/tests/yaml-1.2-spec-examples/example-7.20 b/tests/yaml-1.2-spec-examples/example-7.20 new file mode 100644 index 0000000..19dc4f5 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.20 @@ -0,0 +1,4 @@ +[ +? foo + bar : baz +] diff --git a/tests/yaml-1.2-spec-examples/example-7.21 b/tests/yaml-1.2-spec-examples/example-7.21 new file mode 100644 index 0000000..fdff3b5 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.21 @@ -0,0 +1,3 @@ +- [ YAML : separate ] +- [ : empty key entry ] +- [ {JSON: like}:adjacent ] diff --git a/tests/yaml-1.2-spec-examples/example-7.22 b/tests/yaml-1.2-spec-examples/example-7.22 new file mode 100644 index 0000000..85c6ccb --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.22 @@ -0,0 +1,3 @@ +[ foo + bar: invalid, + "foo...>1K characters...bar": invalid ] diff --git a/tests/yaml-1.2-spec-examples/example-7.23 b/tests/yaml-1.2-spec-examples/example-7.23 new file mode 100644 index 0000000..f709dc8 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.23 @@ -0,0 +1,5 @@ +- [ a, b ] +- { a: b } +- "a" +- 'b' +- c diff --git a/tests/yaml-1.2-spec-examples/example-7.24 b/tests/yaml-1.2-spec-examples/example-7.24 new file mode 100644 index 0000000..db4007f --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.24 @@ -0,0 +1,5 @@ +- !!str "a" +- 'b' +- &anchor "c" +- *anchor +- !!str diff --git a/tests/yaml-1.2-spec-examples/example-7.3 b/tests/yaml-1.2-spec-examples/example-7.3 new file mode 100644 index 0000000..f46900d --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.3 @@ -0,0 +1,4 @@ +{ + ? foo :, + : bar, +} diff --git a/tests/yaml-1.2-spec-examples/example-7.4 b/tests/yaml-1.2-spec-examples/example-7.4 new file mode 100644 index 0000000..1b7a550 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.4 @@ -0,0 +1,3 @@ +"implicit block key" : [ + "implicit flow key" : value, + ] diff --git a/tests/yaml-1.2-spec-examples/example-7.5 b/tests/yaml-1.2-spec-examples/example-7.5 new file mode 100644 index 0000000..eda4b49 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.5 @@ -0,0 +1,5 @@ +"folded +to a space, + +to a line feed, or \ + \ non-content" diff --git a/tests/yaml-1.2-spec-examples/example-7.6 b/tests/yaml-1.2-spec-examples/example-7.6 new file mode 100644 index 0000000..3d8b76d --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.6 @@ -0,0 +1,4 @@ +" 1st non-empty + + 2nd non-empty + 3rd non-empty " diff --git a/tests/yaml-1.2-spec-examples/example-7.7 b/tests/yaml-1.2-spec-examples/example-7.7 new file mode 100644 index 0000000..b038078 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.7 @@ -0,0 +1 @@ + 'here''s to "quotes"' diff --git a/tests/yaml-1.2-spec-examples/example-7.8 b/tests/yaml-1.2-spec-examples/example-7.8 new file mode 100644 index 0000000..f1baf58 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.8 @@ -0,0 +1,3 @@ +'implicit block key' : [ + 'implicit flow key' : value, + ] diff --git a/tests/yaml-1.2-spec-examples/example-7.9 b/tests/yaml-1.2-spec-examples/example-7.9 new file mode 100644 index 0000000..6dd946e --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-7.9 @@ -0,0 +1,4 @@ +' 1st non-empty + + 2nd non-empty + 3rd non-empty ' diff --git a/tests/yaml-1.2-spec-examples/example-8.1 b/tests/yaml-1.2-spec-examples/example-8.1 new file mode 100644 index 0000000..fea9c8b --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.1 @@ -0,0 +1,10 @@ +- | # Empty header + literal +- >1 # Indentation indicator + folded +- |+ # Chomping indicator + keep + +- >1- # Both indicators + strip + diff --git a/tests/yaml-1.2-spec-examples/example-8.10 b/tests/yaml-1.2-spec-examples/example-8.10 new file mode 100644 index 0000000..992dd76 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.10 @@ -0,0 +1,16 @@ +> + + folded + line + + next + line + * bullet + + * list + * lines + + last + line + +# Comment diff --git a/tests/yaml-1.2-spec-examples/example-8.11 b/tests/yaml-1.2-spec-examples/example-8.11 new file mode 100644 index 0000000..992dd76 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.11 @@ -0,0 +1,16 @@ +> + + folded + line + + next + line + * bullet + + * list + * lines + + last + line + +# Comment diff --git a/tests/yaml-1.2-spec-examples/example-8.12 b/tests/yaml-1.2-spec-examples/example-8.12 new file mode 100644 index 0000000..bd226b1 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.12 @@ -0,0 +1,16 @@ +> + + folded + line + + next + line + * bullet + + * list + * line + + last + line + +# Comment diff --git a/tests/yaml-1.2-spec-examples/example-8.13 b/tests/yaml-1.2-spec-examples/example-8.13 new file mode 100644 index 0000000..624f219 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.13 @@ -0,0 +1,15 @@ +> + folded + line + + next + line + * bullet + + * list + * line + + last + line + +# Comment diff --git a/tests/yaml-1.2-spec-examples/example-8.14 b/tests/yaml-1.2-spec-examples/example-8.14 new file mode 100644 index 0000000..d2f2ccf --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.14 @@ -0,0 +1,3 @@ +block sequence: + - one + - two : three diff --git a/tests/yaml-1.2-spec-examples/example-8.15 b/tests/yaml-1.2-spec-examples/example-8.15 new file mode 100644 index 0000000..35ac923 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.15 @@ -0,0 +1,6 @@ +- # Empty +- | + block node +- - one # Compact + - two # sequence +- one: two # Compact mapping diff --git a/tests/yaml-1.2-spec-examples/example-8.16 b/tests/yaml-1.2-spec-examples/example-8.16 new file mode 100644 index 0000000..2ef9084 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.16 @@ -0,0 +1,2 @@ +block mapping: + key: value diff --git a/tests/yaml-1.2-spec-examples/example-8.17 b/tests/yaml-1.2-spec-examples/example-8.17 new file mode 100644 index 0000000..cb0cfd0 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.17 @@ -0,0 +1,5 @@ +? explicit key # Empty value +? | + block key +: - one # Explicit compact + - two # block value diff --git a/tests/yaml-1.2-spec-examples/example-8.18 b/tests/yaml-1.2-spec-examples/example-8.18 new file mode 100644 index 0000000..c819512 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.18 @@ -0,0 +1,4 @@ +plain key: in-line value +: # Both empty +"quoted key": +- entry diff --git a/tests/yaml-1.2-spec-examples/example-8.19 b/tests/yaml-1.2-spec-examples/example-8.19 new file mode 100644 index 0000000..d675cfd --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.19 @@ -0,0 +1,3 @@ +- sun: yellow +- ? earth: blue + : moon: white diff --git a/tests/yaml-1.2-spec-examples/example-8.2 b/tests/yaml-1.2-spec-examples/example-8.2 new file mode 100644 index 0000000..39bee04 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.2 @@ -0,0 +1,11 @@ +- | + detected +- > + + + # detected +- |1 + explicit +- > + + detected diff --git a/tests/yaml-1.2-spec-examples/example-8.20 b/tests/yaml-1.2-spec-examples/example-8.20 new file mode 100644 index 0000000..a3f13ae --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.20 @@ -0,0 +1,6 @@ +- + "flow in block" +- > + Block scalar +- !!map # Block collection + foo : bar diff --git a/tests/yaml-1.2-spec-examples/example-8.21 b/tests/yaml-1.2-spec-examples/example-8.21 new file mode 100644 index 0000000..f86be74 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.21 @@ -0,0 +1,6 @@ +literal: |2 + value +folded: + !foo + >1 + value diff --git a/tests/yaml-1.2-spec-examples/example-8.22 b/tests/yaml-1.2-spec-examples/example-8.22 new file mode 100644 index 0000000..5c59669 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.22 @@ -0,0 +1,6 @@ +sequence: !!seq +- entry +- !!seq + - nested +mapping: !!map + foo: bar diff --git a/tests/yaml-1.2-spec-examples/example-8.3 b/tests/yaml-1.2-spec-examples/example-8.3 new file mode 100644 index 0000000..46edf9f --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.3 @@ -0,0 +1,8 @@ +- | + + text +- > + text + text +- |2 + text diff --git a/tests/yaml-1.2-spec-examples/example-8.4 b/tests/yaml-1.2-spec-examples/example-8.4 new file mode 100644 index 0000000..fa6190f --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.4 @@ -0,0 +1,6 @@ +strip: |- + text +clip: | + text +keep: |+ + text diff --git a/tests/yaml-1.2-spec-examples/example-8.5 b/tests/yaml-1.2-spec-examples/example-8.5 new file mode 100644 index 0000000..44a314c --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.5 @@ -0,0 +1,19 @@ + # Strip + # Comments: +strip: |- + # text + ⇓ + # Clip + # comments: + +clip: | + # text + + # Keep + # comments: + +keep: |+ + # text + + # Trail + # comments. diff --git a/tests/yaml-1.2-spec-examples/example-8.6 b/tests/yaml-1.2-spec-examples/example-8.6 new file mode 100644 index 0000000..de0b64b --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.6 @@ -0,0 +1,6 @@ +strip: >- + +clip: > + +keep: |+ + diff --git a/tests/yaml-1.2-spec-examples/example-8.7 b/tests/yaml-1.2-spec-examples/example-8.7 new file mode 100644 index 0000000..7fa415f --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.7 @@ -0,0 +1,4 @@ +| + literal + text + diff --git a/tests/yaml-1.2-spec-examples/example-8.8 b/tests/yaml-1.2-spec-examples/example-8.8 new file mode 100644 index 0000000..9d537cb --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.8 @@ -0,0 +1,9 @@ +| + + + literal + + + text + + # Comment diff --git a/tests/yaml-1.2-spec-examples/example-8.9 b/tests/yaml-1.2-spec-examples/example-8.9 new file mode 100644 index 0000000..c016ca9 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-8.9 @@ -0,0 +1,4 @@ +> + folded + text + diff --git a/tests/yaml-1.2-spec-examples/example-9.1 b/tests/yaml-1.2-spec-examples/example-9.1 new file mode 100644 index 0000000..59b6591 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-9.1 @@ -0,0 +1,3 @@ +# Comment +# lines +Document diff --git a/tests/yaml-1.2-spec-examples/example-9.2 b/tests/yaml-1.2-spec-examples/example-9.2 new file mode 100644 index 0000000..886e574 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-9.2 @@ -0,0 +1,4 @@ +%YAML 1.2 +--- +Document +... # Suffix diff --git a/tests/yaml-1.2-spec-examples/example-9.3 b/tests/yaml-1.2-spec-examples/example-9.3 new file mode 100644 index 0000000..57423e9 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-9.3 @@ -0,0 +1,7 @@ +Bare +document +... +# No document +... +| +%!PS-Adobe-2.0 # Not the first line diff --git a/tests/yaml-1.2-spec-examples/example-9.4 b/tests/yaml-1.2-spec-examples/example-9.4 new file mode 100644 index 0000000..bc363b1 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-9.4 @@ -0,0 +1,7 @@ +--- +{ matches +% : 20 } +... +--- +# Empty +... diff --git a/tests/yaml-1.2-spec-examples/example-9.5 b/tests/yaml-1.2-spec-examples/example-9.5 new file mode 100644 index 0000000..de2463d --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-9.5 @@ -0,0 +1,8 @@ +%YAML 1.2 +--- | +%!PS-Adobe-2.0 +... +%YAML1.2 +--- +# Empty +... diff --git a/tests/yaml-1.2-spec-examples/example-9.6 b/tests/yaml-1.2-spec-examples/example-9.6 new file mode 100644 index 0000000..52bd345 --- /dev/null +++ b/tests/yaml-1.2-spec-examples/example-9.6 @@ -0,0 +1,7 @@ +Document +--- +# Empty +... +%YAML 1.2 +--- +matches %: 20