├── .github ├── SECURITY.md ├── actions │ └── dynamatrix │ │ ├── action.yml │ │ └── matrix_yaml_to_json.py └── workflows │ └── ci.yaml ├── .gitignore ├── CHANGES ├── LICENSE ├── MANIFEST.in ├── Makefile ├── README.md ├── announcement.msg ├── examples ├── pygments-lexer │ ├── example.yaml │ └── yaml.py └── yaml-highlight │ ├── yaml_hl.cfg │ └── yaml_hl.py ├── lib ├── _yaml │ └── __init__.py └── yaml │ ├── __init__.py │ ├── composer.py │ ├── constructor.py │ ├── cyaml.py │ ├── dumper.py │ ├── emitter.py │ ├── error.py │ ├── events.py │ ├── loader.py │ ├── nodes.py │ ├── parser.py │ ├── reader.py │ ├── representer.py │ ├── resolver.py │ ├── scanner.py │ ├── serializer.py │ └── tokens.py ├── packaging ├── _pyyaml_pep517.py └── build │ ├── libyaml.sh │ └── smoketest.py ├── pyproject.toml ├── setup.py ├── tests ├── legacy_tests │ ├── canonical.py │ ├── conftest.py │ ├── data │ │ ├── a-nasty-libyaml-bug.loader-error │ │ ├── aliases-cdumper-bug.code │ │ ├── aliases.events │ │ ├── bool.data │ │ ├── bool.detect │ │ ├── construct-binary-py2.code │ │ ├── construct-binary-py2.data │ │ ├── construct-binary-py3.code │ │ ├── construct-binary-py3.data │ │ ├── construct-bool.code │ │ ├── construct-bool.data │ │ ├── construct-custom.code │ │ ├── construct-custom.data │ │ ├── construct-float.code │ │ ├── construct-float.data │ │ ├── construct-int.code │ │ ├── construct-int.data │ │ ├── construct-map.code │ │ ├── construct-map.data │ │ ├── construct-merge.code │ │ ├── construct-merge.data │ │ ├── construct-null.code │ │ ├── construct-null.data │ │ ├── construct-omap.code │ │ ├── construct-omap.data │ │ ├── construct-pairs.code │ │ ├── construct-pairs.data │ │ ├── construct-python-bool.code │ │ ├── construct-python-bool.data │ │ ├── construct-python-bytes-py3.code │ │ ├── construct-python-bytes-py3.data │ │ ├── construct-python-complex.code │ │ ├── construct-python-complex.data │ │ ├── construct-python-float.code │ │ ├── construct-python-float.data │ │ ├── construct-python-int.code │ │ ├── construct-python-int.data │ │ ├── construct-python-long-short-py2.code │ │ ├── construct-python-long-short-py2.data │ │ ├── construct-python-long-short-py3.code │ │ ├── construct-python-long-short-py3.data │ │ ├── construct-python-name-module.code │ │ ├── construct-python-name-module.data │ │ ├── construct-python-none.code │ │ ├── construct-python-none.data │ │ ├── construct-python-object.code │ │ ├── construct-python-object.data │ │ ├── construct-python-str-ascii.code │ │ ├── construct-python-str-ascii.data │ │ ├── construct-python-str-utf8-py2.code │ │ ├── construct-python-str-utf8-py2.data │ │ ├── construct-python-str-utf8-py3.code │ │ ├── construct-python-str-utf8-py3.data │ │ ├── construct-python-tuple-list-dict.code │ │ ├── construct-python-tuple-list-dict.data │ │ ├── construct-python-unicode-ascii-py2.code │ │ ├── construct-python-unicode-ascii-py2.data │ │ ├── construct-python-unicode-ascii-py3.code │ │ ├── construct-python-unicode-ascii-py3.data │ │ ├── construct-python-unicode-utf8-py2.code │ │ ├── construct-python-unicode-utf8-py2.data │ │ ├── construct-python-unicode-utf8-py3.code │ │ ├── construct-python-unicode-utf8-py3.data │ │ ├── construct-seq.code │ │ ├── construct-seq.data │ │ ├── construct-set.code │ │ ├── construct-set.data │ │ ├── construct-str-ascii.code │ │ ├── construct-str-ascii.data │ │ ├── construct-str-utf8-py2.code │ │ ├── construct-str-utf8-py2.data │ │ ├── construct-str-utf8-py3.code │ │ ├── construct-str-utf8-py3.data │ │ ├── construct-str.code │ │ ├── construct-str.data │ │ ├── construct-timestamp.code │ │ ├── construct-timestamp.data │ │ ├── construct-value.code │ │ ├── construct-value.data │ │ ├── document-separator-in-quoted-scalar.loader-error │ │ ├── documents.events │ │ ├── duplicate-anchor-1.loader-error │ │ ├── duplicate-anchor-2.loader-error │ │ ├── duplicate-key.former-loader-error.code │ │ ├── duplicate-key.former-loader-error.data │ │ ├── duplicate-mapping-key.former-loader-error.code │ │ ├── duplicate-mapping-key.former-loader-error.data │ │ ├── duplicate-merge-key.former-loader-error.code │ │ ├── duplicate-merge-key.former-loader-error.data │ │ ├── duplicate-tag-directive.loader-error │ │ ├── duplicate-value-key.former-loader-error.code │ │ ├── duplicate-value-key.former-loader-error.data │ │ ├── duplicate-yaml-directive.loader-error │ │ ├── emit-block-scalar-in-simple-key-context-bug.canonical │ │ ├── emit-block-scalar-in-simple-key-context-bug.data │ │ ├── emitting-unacceptable-unicode-character-bug-py3.code │ │ ├── emitting-unacceptable-unicode-character-bug-py3.data │ │ ├── emitting-unacceptable-unicode-character-bug-py3.skip-ext │ │ ├── emitting-unacceptable-unicode-character-bug.code │ │ ├── emitting-unacceptable-unicode-character-bug.data │ │ ├── emitting-unacceptable-unicode-character-bug.skip-ext │ │ ├── emoticons.unicode │ │ ├── emoticons2.unicode │ │ ├── empty-anchor.emitter-error │ │ ├── empty-document-bug.canonical │ │ ├── empty-document-bug.data │ │ ├── empty-document-bug.empty │ │ ├── empty-documents.single-loader-error │ │ ├── empty-python-module.loader-error │ │ ├── empty-python-name.loader-error │ │ ├── empty-tag-handle.emitter-error │ │ ├── empty-tag-prefix.emitter-error │ │ ├── empty-tag.emitter-error │ │ ├── expected-document-end.emitter-error │ │ ├── expected-document-start.emitter-error │ │ ├── expected-mapping.loader-error │ │ ├── expected-node-1.emitter-error │ │ ├── expected-node-2.emitter-error │ │ ├── expected-nothing.emitter-error │ │ ├── expected-scalar.loader-error │ │ ├── expected-sequence.loader-error │ │ ├── expected-stream-start.emitter-error │ │ ├── explicit-document.single-loader-error │ │ ├── fetch-complex-value-bug.loader-error │ │ ├── float-representer-2.3-bug.code │ │ ├── float-representer-2.3-bug.data │ │ ├── float.data │ │ ├── float.detect │ │ ├── forbidden-entry.loader-error │ │ ├── forbidden-key.loader-error │ │ ├── forbidden-value.loader-error │ │ ├── implicit-document.single-loader-error │ │ ├── int.data │ │ ├── int.detect │ │ ├── invalid-anchor-1.loader-error │ │ ├── invalid-anchor-2.loader-error │ │ ├── invalid-anchor.emitter-error │ │ ├── invalid-base64-data-2.loader-error │ │ ├── invalid-base64-data.loader-error │ │ ├── invalid-block-scalar-indicator.loader-error │ │ ├── invalid-character.loader-error │ │ ├── invalid-character.stream-error │ │ ├── invalid-directive-line.loader-error │ │ ├── invalid-directive-name-1.loader-error │ │ ├── invalid-directive-name-2.loader-error │ │ ├── invalid-escape-character.loader-error │ │ ├── invalid-escape-numbers.loader-error │ │ ├── invalid-indentation-indicator-1.loader-error │ │ ├── invalid-indentation-indicator-2.loader-error │ │ ├── invalid-item-without-trailing-break.loader-error │ │ ├── invalid-merge-1.loader-error │ │ ├── invalid-merge-2.loader-error │ │ ├── invalid-omap-1.loader-error │ │ ├── invalid-omap-2.loader-error │ │ ├── invalid-omap-3.loader-error │ │ ├── invalid-pairs-1.loader-error │ │ ├── invalid-pairs-2.loader-error │ │ ├── invalid-pairs-3.loader-error │ │ ├── invalid-python-bytes-2-py3.loader-error │ │ ├── invalid-python-bytes-py3.loader-error │ │ ├── invalid-python-module-kind.loader-error │ │ ├── invalid-python-module-value.loader-error │ │ ├── invalid-python-module.loader-error │ │ ├── invalid-python-name-kind.loader-error │ │ ├── invalid-python-name-module.loader-error │ │ ├── invalid-python-name-object.loader-error │ │ ├── invalid-python-name-value.loader-error │ │ ├── invalid-simple-key.loader-error │ │ ├── invalid-single-quote-bug.code │ │ ├── invalid-single-quote-bug.data │ │ ├── invalid-starting-character.loader-error │ │ ├── invalid-tag-1.loader-error │ │ ├── invalid-tag-2.loader-error │ │ ├── invalid-tag-directive-handle.loader-error │ │ ├── invalid-tag-directive-prefix.loader-error │ │ ├── invalid-tag-handle-1.emitter-error │ │ ├── invalid-tag-handle-1.loader-error │ │ ├── invalid-tag-handle-2.emitter-error │ │ ├── invalid-tag-handle-2.loader-error │ │ ├── invalid-uri-escapes-1.loader-error │ │ ├── invalid-uri-escapes-2.loader-error │ │ ├── invalid-uri-escapes-3.loader-error │ │ ├── invalid-uri.loader-error │ │ ├── invalid-utf8-byte.loader-error │ │ ├── invalid-utf8-byte.stream-error │ │ ├── invalid-yaml-directive-version-1.loader-error │ │ ├── invalid-yaml-directive-version-2.loader-error │ │ ├── invalid-yaml-directive-version-3.loader-error │ │ ├── invalid-yaml-directive-version-4.loader-error │ │ ├── invalid-yaml-directive-version-5.loader-error │ │ ├── invalid-yaml-directive-version-6.loader-error │ │ ├── invalid-yaml-version.loader-error │ │ ├── latin.unicode │ │ ├── mapping.sort │ │ ├── mapping.sorted │ │ ├── mappings.events │ │ ├── merge.data │ │ ├── merge.detect │ │ ├── more-floats.code │ │ ├── more-floats.data │ │ ├── multi-constructor.code │ │ ├── multi-constructor.multi │ │ ├── myfullloader.subclass_blacklist │ │ ├── negative-float-bug.code │ │ ├── negative-float-bug.data │ │ ├── no-alias-anchor.emitter-error │ │ ├── no-alias-anchor.skip-ext │ │ ├── no-block-collection-end.loader-error │ │ ├── no-block-mapping-end-2.loader-error │ │ ├── no-block-mapping-end.loader-error │ │ ├── no-document-start.loader-error │ │ ├── no-flow-mapping-end.loader-error │ │ ├── no-flow-sequence-end.loader-error │ │ ├── no-node-1.loader-error │ │ ├── no-node-2.loader-error │ │ ├── no-tag.emitter-error │ │ ├── null.data │ │ ├── null.detect │ │ ├── odd-utf16.stream-error │ │ ├── overwrite-state-new-constructor.loader-error │ │ ├── recursive-anchor.former-loader-error │ │ ├── recursive-dict.recursive │ │ ├── recursive-list.recursive │ │ ├── recursive-set.recursive │ │ ├── recursive-state.recursive │ │ ├── recursive-tuple.recursive │ │ ├── recursive.former-dumper-error │ │ ├── remove-possible-simple-key-bug.loader-error │ │ ├── resolver.data │ │ ├── resolver.path │ │ ├── run-parser-crash-bug.data │ │ ├── scalars.events │ │ ├── scan-document-end-bug.canonical │ │ ├── scan-document-end-bug.data │ │ ├── scan-line-break-bug.canonical │ │ ├── scan-line-break-bug.data │ │ ├── sequences.events │ │ ├── serializer-is-already-opened.dumper-error │ │ ├── serializer-is-closed-1.dumper-error │ │ ├── serializer-is-closed-2.dumper-error │ │ ├── serializer-is-not-opened-1.dumper-error │ │ ├── serializer-is-not-opened-2.dumper-error │ │ ├── single-dot-is-not-float-bug.code │ │ ├── single-dot-is-not-float-bug.data │ │ ├── sloppy-indentation.canonical │ │ ├── sloppy-indentation.data │ │ ├── spec-02-01.data │ │ ├── spec-02-01.structure │ │ ├── spec-02-01.tokens │ │ ├── spec-02-02.data │ │ ├── spec-02-02.structure │ │ ├── spec-02-02.tokens │ │ ├── spec-02-03.data │ │ ├── spec-02-03.structure │ │ ├── spec-02-03.tokens │ │ ├── spec-02-04.data │ │ ├── spec-02-04.structure │ │ ├── spec-02-04.tokens │ │ ├── spec-02-05.data │ │ ├── spec-02-05.structure │ │ ├── spec-02-05.tokens │ │ ├── spec-02-06.data │ │ ├── spec-02-06.structure │ │ ├── spec-02-06.tokens │ │ ├── spec-02-07.data │ │ ├── spec-02-07.structure │ │ ├── spec-02-07.tokens │ │ ├── spec-02-08.data │ │ ├── spec-02-08.structure │ │ ├── spec-02-08.tokens │ │ ├── spec-02-09.data │ │ ├── spec-02-09.structure │ │ ├── spec-02-09.tokens │ │ ├── spec-02-10.data │ │ ├── spec-02-10.structure │ │ ├── spec-02-10.tokens │ │ ├── spec-02-11.data │ │ ├── spec-02-11.structure │ │ ├── spec-02-11.tokens │ │ ├── spec-02-12.data │ │ ├── spec-02-12.structure │ │ ├── spec-02-12.tokens │ │ ├── spec-02-13.data │ │ ├── spec-02-13.structure │ │ ├── spec-02-13.tokens │ │ ├── spec-02-14.data │ │ ├── spec-02-14.structure │ │ ├── spec-02-14.tokens │ │ ├── spec-02-15.data │ │ ├── spec-02-15.structure │ │ ├── spec-02-15.tokens │ │ ├── spec-02-16.data │ │ ├── spec-02-16.structure │ │ ├── spec-02-16.tokens │ │ ├── spec-02-17.data │ │ ├── spec-02-17.structure │ │ ├── spec-02-17.tokens │ │ ├── spec-02-18.data │ │ ├── spec-02-18.structure │ │ ├── spec-02-18.tokens │ │ ├── spec-02-19.data │ │ ├── spec-02-19.structure │ │ ├── spec-02-19.tokens │ │ ├── spec-02-20.data │ │ ├── spec-02-20.structure │ │ ├── spec-02-20.tokens │ │ ├── spec-02-21.data │ │ ├── spec-02-21.structure │ │ ├── spec-02-21.tokens │ │ ├── spec-02-22.data │ │ ├── spec-02-22.structure │ │ ├── spec-02-22.tokens │ │ ├── spec-02-23.data │ │ ├── spec-02-23.structure │ │ ├── spec-02-23.tokens │ │ ├── spec-02-24.data │ │ ├── spec-02-24.structure │ │ ├── spec-02-24.tokens │ │ ├── spec-02-25.data │ │ ├── spec-02-25.structure │ │ ├── spec-02-25.tokens │ │ ├── spec-02-26.data │ │ ├── spec-02-26.structure │ │ ├── spec-02-26.tokens │ │ ├── spec-02-27.data │ │ ├── spec-02-27.structure │ │ ├── spec-02-27.tokens │ │ ├── spec-02-28.data │ │ ├── spec-02-28.structure │ │ ├── spec-02-28.tokens │ │ ├── spec-05-01-utf16be.data │ │ ├── spec-05-01-utf16be.empty │ │ ├── spec-05-01-utf16le.data │ │ ├── spec-05-01-utf16le.empty │ │ ├── spec-05-01-utf8.data │ │ ├── spec-05-01-utf8.empty │ │ ├── spec-05-02-utf16be.data │ │ ├── spec-05-02-utf16be.error │ │ ├── spec-05-02-utf16le.data │ │ ├── spec-05-02-utf16le.error │ │ ├── spec-05-02-utf8.data │ │ ├── spec-05-02-utf8.error │ │ ├── spec-05-03.canonical │ │ ├── spec-05-03.data │ │ ├── spec-05-04.canonical │ │ ├── spec-05-04.data │ │ ├── spec-05-05.data │ │ ├── spec-05-05.empty │ │ ├── spec-05-06.canonical │ │ ├── spec-05-06.data │ │ ├── spec-05-07.canonical │ │ ├── spec-05-07.data │ │ ├── spec-05-08.canonical │ │ ├── spec-05-08.data │ │ ├── spec-05-09.canonical │ │ ├── spec-05-09.data │ │ ├── spec-05-10.data │ │ ├── spec-05-10.error │ │ ├── spec-05-11.canonical │ │ ├── spec-05-11.data │ │ ├── spec-05-12.data │ │ ├── spec-05-12.error │ │ ├── spec-05-13.canonical │ │ ├── spec-05-13.data │ │ ├── spec-05-14.canonical │ │ ├── spec-05-14.data │ │ ├── spec-05-15.data │ │ ├── spec-05-15.error │ │ ├── spec-06-01.canonical │ │ ├── spec-06-01.data │ │ ├── spec-06-02.data │ │ ├── spec-06-02.empty │ │ ├── spec-06-03.canonical │ │ ├── spec-06-03.data │ │ ├── spec-06-04.canonical │ │ ├── spec-06-04.data │ │ ├── spec-06-05.canonical │ │ ├── spec-06-05.data │ │ ├── spec-06-06.canonical │ │ ├── spec-06-06.data │ │ ├── spec-06-07.canonical │ │ ├── spec-06-07.data │ │ ├── spec-06-08.canonical │ │ ├── spec-06-08.data │ │ ├── spec-07-01.canonical │ │ ├── spec-07-01.data │ │ ├── spec-07-01.skip-ext │ │ ├── spec-07-02.canonical │ │ ├── spec-07-02.data │ │ ├── spec-07-02.skip-ext │ │ ├── spec-07-03.data │ │ ├── spec-07-03.error │ │ ├── spec-07-04.canonical │ │ ├── spec-07-04.data │ │ ├── spec-07-05.data │ │ ├── spec-07-05.error │ │ ├── spec-07-06.canonical │ │ ├── spec-07-06.data │ │ ├── spec-07-07a.canonical │ │ ├── spec-07-07a.data │ │ ├── spec-07-07b.canonical │ │ ├── spec-07-07b.data │ │ ├── spec-07-08.canonical │ │ ├── spec-07-08.data │ │ ├── spec-07-09.canonical │ │ ├── spec-07-09.data │ │ ├── spec-07-10.canonical │ │ ├── spec-07-10.data │ │ ├── spec-07-11.data │ │ ├── spec-07-11.empty │ │ ├── spec-07-12a.canonical │ │ ├── spec-07-12a.data │ │ ├── spec-07-12b.canonical │ │ ├── spec-07-12b.data │ │ ├── spec-07-13.canonical │ │ ├── spec-07-13.data │ │ ├── spec-08-01.canonical │ │ ├── spec-08-01.data │ │ ├── spec-08-02.canonical │ │ ├── spec-08-02.data │ │ ├── spec-08-03.canonical │ │ ├── spec-08-03.data │ │ ├── spec-08-04.data │ │ ├── spec-08-04.error │ │ ├── spec-08-05.canonical │ │ ├── spec-08-05.data │ │ ├── spec-08-06.data │ │ ├── spec-08-06.error │ │ ├── spec-08-07.canonical │ │ ├── spec-08-07.data │ │ ├── spec-08-08.canonical │ │ ├── spec-08-08.data │ │ ├── spec-08-09.canonical │ │ ├── spec-08-09.data │ │ ├── spec-08-10.canonical │ │ ├── spec-08-10.data │ │ ├── spec-08-11.canonical │ │ ├── spec-08-11.data │ │ ├── spec-08-12.canonical │ │ ├── spec-08-12.data │ │ ├── spec-08-13.canonical │ │ ├── spec-08-13.data │ │ ├── spec-08-13.skip-ext │ │ ├── spec-08-14.canonical │ │ ├── spec-08-14.data │ │ ├── spec-08-15.canonical │ │ ├── spec-08-15.data │ │ ├── spec-09-01.canonical │ │ ├── spec-09-01.data │ │ ├── spec-09-02.canonical │ │ ├── spec-09-02.data │ │ ├── spec-09-03.canonical │ │ ├── spec-09-03.data │ │ ├── spec-09-04.canonical │ │ ├── spec-09-04.data │ │ ├── spec-09-05.canonical │ │ ├── spec-09-05.data │ │ ├── spec-09-06.canonical │ │ ├── spec-09-06.data │ │ ├── spec-09-07.canonical │ │ ├── spec-09-07.data │ │ ├── spec-09-08.canonical │ │ ├── spec-09-08.data │ │ ├── spec-09-09.canonical │ │ ├── spec-09-09.data │ │ ├── spec-09-10.canonical │ │ ├── spec-09-10.data │ │ ├── spec-09-11.canonical │ │ ├── spec-09-11.data │ │ ├── spec-09-12.canonical │ │ ├── spec-09-12.data │ │ ├── spec-09-13.canonical │ │ ├── spec-09-13.data │ │ ├── spec-09-14.data │ │ ├── spec-09-14.error │ │ ├── spec-09-15.canonical │ │ ├── spec-09-15.data │ │ ├── spec-09-16.canonical │ │ ├── spec-09-16.data │ │ ├── spec-09-17.canonical │ │ ├── spec-09-17.data │ │ ├── spec-09-18.canonical │ │ ├── spec-09-18.data │ │ ├── spec-09-19.canonical │ │ ├── spec-09-19.data │ │ ├── spec-09-20.canonical │ │ ├── spec-09-20.data │ │ ├── spec-09-20.skip-ext │ │ ├── spec-09-21.data │ │ ├── spec-09-21.error │ │ ├── spec-09-22.canonical │ │ ├── spec-09-22.data │ │ ├── spec-09-23.canonical │ │ ├── spec-09-23.data │ │ ├── spec-09-24.canonical │ │ ├── spec-09-24.data │ │ ├── spec-09-25.canonical │ │ ├── spec-09-25.data │ │ ├── spec-09-26.canonical │ │ ├── spec-09-26.data │ │ ├── spec-09-27.canonical │ │ ├── spec-09-27.data │ │ ├── spec-09-28.canonical │ │ ├── spec-09-28.data │ │ ├── spec-09-29.canonical │ │ ├── spec-09-29.data │ │ ├── spec-09-30.canonical │ │ ├── spec-09-30.data │ │ ├── spec-09-31.canonical │ │ ├── spec-09-31.data │ │ ├── spec-09-32.canonical │ │ ├── spec-09-32.data │ │ ├── spec-09-33.canonical │ │ ├── spec-09-33.data │ │ ├── spec-10-01.canonical │ │ ├── spec-10-01.data │ │ ├── spec-10-02.canonical │ │ ├── spec-10-02.data │ │ ├── spec-10-03.canonical │ │ ├── spec-10-03.data │ │ ├── spec-10-04.canonical │ │ ├── spec-10-04.data │ │ ├── spec-10-05.canonical │ │ ├── spec-10-05.data │ │ ├── spec-10-06.canonical │ │ ├── spec-10-06.data │ │ ├── spec-10-07.canonical │ │ ├── spec-10-07.data │ │ ├── spec-10-08.data │ │ ├── spec-10-08.error │ │ ├── spec-10-09.canonical │ │ ├── spec-10-09.data │ │ ├── spec-10-10.canonical │ │ ├── spec-10-10.data │ │ ├── spec-10-11.canonical │ │ ├── spec-10-11.data │ │ ├── spec-10-12.canonical │ │ ├── spec-10-12.data │ │ ├── spec-10-13.canonical │ │ ├── spec-10-13.data │ │ ├── spec-10-14.canonical │ │ ├── spec-10-14.data │ │ ├── spec-10-15.canonical │ │ ├── spec-10-15.data │ │ ├── str.data │ │ ├── str.detect │ │ ├── tags.events │ │ ├── test_mark.marks │ │ ├── timestamp-bugs.code │ │ ├── timestamp-bugs.data │ │ ├── timestamp.data │ │ ├── timestamp.detect │ │ ├── unacceptable-key.loader-error │ │ ├── unclosed-bracket.loader-error │ │ ├── unclosed-quoted-scalar.loader-error │ │ ├── undefined-anchor.loader-error │ │ ├── undefined-constructor.loader-error │ │ ├── undefined-tag-handle.loader-error │ │ ├── unknown.dumper-error │ │ ├── unsupported-version.emitter-error │ │ ├── utf16be.code │ │ ├── utf16be.data │ │ ├── utf16le.code │ │ ├── utf16le.data │ │ ├── utf8-implicit.code │ │ ├── utf8-implicit.data │ │ ├── utf8.code │ │ ├── utf8.data │ │ ├── value.data │ │ ├── value.detect │ │ ├── yaml.data │ │ ├── yaml.detect │ │ ├── yaml11.schema │ │ └── yaml11.schema-skip │ ├── test_all.py │ ├── test_appliance.py │ ├── test_build.py │ ├── test_build_ext.py │ ├── test_canonical.py │ ├── test_constructor.py │ ├── test_emitter.py │ ├── test_errors.py │ ├── test_input_output.py │ ├── test_mark.py │ ├── test_multi_constructor.py │ ├── test_reader.py │ ├── test_recursive.py │ ├── test_representer.py │ ├── test_resolver.py │ ├── test_schema.py │ ├── test_sort_keys.py │ ├── test_structure.py │ ├── test_tokens.py │ ├── test_yaml.py │ └── test_yaml_ext.py └── test_dump_load.py ├── tox.ini └── yaml ├── __init__.pxd ├── _yaml.h ├── _yaml.pxd └── _yaml.pyx /.github/SECURITY.md: -------------------------------------------------------------------------------- 1 | # PyYAML Security Policy 2 | 3 | ## Reporting a Suspected Vulnerability 4 | 5 | The PyYAML project encourages responsible disclosure of suspected security 6 | vulnerabilities. However, we do not offer bug bounties, paid disclosure, or 7 | paid fixes for discovered vulnerabilities. To report a suspected security 8 | vulnerability, please e-mail details to without creating 9 | public issues, pull requests, or discussion. Non-security correspondence to 10 | this address will be ignored. 11 | -------------------------------------------------------------------------------- /.github/actions/dynamatrix/action.yml: -------------------------------------------------------------------------------- 1 | name: Create matrix 2 | description: Create matrix 3 | inputs: 4 | matrix_yaml: 5 | description: input yaml matrix as multiline string; any entry with a bool true `omit` key will be filtered from the output matrix 6 | required: true 7 | outputs: 8 | matrix_json: 9 | description: filtered matrix as JSON 10 | value: ${{ steps.matrix_gen.outputs.matrix_json }} 11 | 12 | runs: 13 | using: "composite" 14 | 15 | steps: 16 | - id: matrix_gen 17 | run: | 18 | # FIXME: input sanity check to prevent shell injection 19 | python3 $GITHUB_ACTION_PATH/matrix_yaml_to_json.py --from-stdin << EOF 20 | ${{ inputs.matrix_yaml }} 21 | EOF 22 | shell: bash 23 | -------------------------------------------------------------------------------- /.github/actions/dynamatrix/matrix_yaml_to_json.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import argparse 4 | import json 5 | import os 6 | import pathlib 7 | import sys 8 | import typing as t 9 | import yaml 10 | 11 | from collections.abc import MutableMapping, Sequence 12 | 13 | skipped_entries = [] 14 | 15 | def _filter_omit_entries(value): 16 | if isinstance(value, MutableMapping): 17 | if (omit_value := value.pop('omit', ...)) is not ...: 18 | if omit_value is True or str(omit_value).lower().strip() == 'true': 19 | print(f'omitting {value} from matrix') 20 | skipped_entries.append(value) 21 | return ... 22 | 23 | return {k: v for k, v in ((k, _filter_omit_entries(v)) for k, v in value.items()) if v is not ...} 24 | 25 | if isinstance(value, str): 26 | return value 27 | 28 | if isinstance(value, Sequence): 29 | return [v for v in (_filter_omit_entries(v) for v in value) if v is not ...] 30 | 31 | return value 32 | 33 | def main(): 34 | p = argparse.ArgumentParser(description='GHA YAML matrix filter') 35 | required_grp = p.add_mutually_exclusive_group(required=True) 36 | required_grp.add_argument('--from-stdin', action='store_true', help='read input YAML from stdin') 37 | required_grp.add_argument('--from-file', type=pathlib.Path, help='read input YAML from file path') 38 | 39 | args = p.parse_args() 40 | 41 | path: pathlib.Path | None 42 | 43 | matrix_yaml: str 44 | 45 | if path := args.from_file: 46 | matrix_yaml = path.read_text() 47 | elif args.from_stdin: 48 | matrix_yaml = sys.stdin.read() 49 | else: 50 | raise Exception('no source provided for matrix yaml') 51 | 52 | raw_matrix = yaml.safe_load(matrix_yaml) 53 | filtered_matrix = _filter_omit_entries(raw_matrix) 54 | 55 | output_matrix_json = json.dumps(filtered_matrix) 56 | output_skipped_matrix_json = json.dumps(skipped_entries) 57 | 58 | print(f'filtered matrix: {output_matrix_json}') 59 | print(f'skipped entries: {output_skipped_matrix_json}') 60 | 61 | if (gh_output := os.environ.get('GITHUB_OUTPUT')): 62 | print('setting step output var matrix_json; skipped_matrix_json...') 63 | with pathlib.Path(gh_output).open('a') as env_fd: 64 | env_fd.write(f'matrix_json<<__MATRIX_EOF\n{output_matrix_json}\n__MATRIX_EOF\n') 65 | env_fd.write(f'skipped_matrix_json<<__MATRIX_EOF\n{output_skipped_matrix_json}\n__MATRIX_EOF\n') 66 | else: 67 | print("GITHUB_OUTPUT not set; skipping variable output") 68 | 69 | 70 | if __name__ == '__main__': 71 | main() 72 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # build outputs 2 | /dist/* 3 | /build/* 4 | /lib/PyYAML.egg-info/* 5 | /wheelhouse/* 6 | /yaml/_yaml.c 7 | MANIFEST 8 | **/*.so 9 | **/*.dylib 10 | **/*.pyd 11 | 12 | 13 | # cached Python binaries 14 | *.py[cdo] 15 | _pycache_/* 16 | 17 | # local IDE state 18 | /.idea/* 19 | /.tox/* 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017-2021 Ingy döt Net 2 | Copyright (c) 2006-2016 Kirill Simonov 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | of the Software, and to permit persons to whom the Software is furnished to do 9 | so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. 21 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include CHANGES README LICENSE Makefile pyproject.toml setup.py 2 | recursive-include lib/yaml *.py 3 | recursive-include lib/_yaml *.py 4 | recursive-include packaging * 5 | recursive-include examples *.py *.cfg *.yaml 6 | recursive-include tests/legacy_tests/ *.py 7 | recursive-include tests/legacy_tests/data * 8 | recursive-include yaml * 9 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | .PHONY: build dist 3 | 4 | PYTHON=/usr/bin/python3 5 | TEST= 6 | PARAMETERS= 7 | 8 | build: 9 | ${PYTHON} setup.py build ${PARAMETERS} 10 | 11 | buildext: 12 | ${PYTHON} setup.py --with-libyaml build ${PARAMETERS} 13 | 14 | force: 15 | ${PYTHON} setup.py build -f ${PARAMETERS} 16 | 17 | forceext: 18 | ${PYTHON} setup.py --with-libyaml build -f ${PARAMETERS} 19 | 20 | install: 21 | ${PYTHON} setup.py install ${PARAMETERS} 22 | 23 | installext: 24 | ${PYTHON} setup.py --with-libyaml install ${PARAMETERS} 25 | 26 | test: build 27 | PYYAML_FORCE_LIBYAML=0 ${PYTHON} -I -m pytest 28 | 29 | testext: buildext 30 | PYYAML_FORCE_LIBYAML=1 ${PYTHON} -I -m pytest 31 | 32 | testall: 33 | ${PYTHON} -m pytest 34 | 35 | dist: 36 | @# No longer uploading a zip file to pypi 37 | @# ${PYTHON} setup.py --with-libyaml sdist --formats=zip,gztar 38 | ${PYTHON} setup.py --with-libyaml sdist --formats=gztar 39 | 40 | clean: 41 | ${PYTHON} setup.py --with-libyaml clean -a 42 | rm -fr \ 43 | dist/ \ 44 | lib/PyYAML.egg-info/ \ 45 | lib/yaml/__pycache__/ \ 46 | tests/__pycache__/ \ 47 | tests/legacy_tests/__pycache__/ \ 48 | yaml/_yaml.c 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | PyYAML 2 | ====== 3 | 4 | A full-featured YAML processing framework for Python 5 | 6 | ## Installation 7 | 8 | To install, type `python setup.py install`. 9 | 10 | By default, the `setup.py` script checks whether LibYAML is installed and if 11 | so, builds and installs LibYAML bindings. 12 | To skip the check and force installation of LibYAML bindings, use the option 13 | `--with-libyaml`: `python setup.py --with-libyaml install`. 14 | To disable the check and skip building and installing LibYAML bindings, use 15 | `--without-libyaml`: `python setup.py --without-libyaml install`. 16 | 17 | When LibYAML bindings are installed, you may use fast LibYAML-based parser and 18 | emitter as follows: 19 | 20 | >>> yaml.load(stream, Loader=yaml.CLoader) 21 | >>> yaml.dump(data, Dumper=yaml.CDumper) 22 | 23 | If you don't trust the input YAML stream, you should use: 24 | 25 | >>> yaml.safe_load(stream) 26 | 27 | ## Testing 28 | 29 | PyYAML includes a comprehensive test suite. 30 | To run the tests, type `python setup.py test`. 31 | 32 | ## Further Information 33 | 34 | * For more information, check the 35 | [PyYAML homepage](https://github.com/yaml/pyyaml). 36 | 37 | * [PyYAML tutorial and reference](http://pyyaml.org/wiki/PyYAMLDocumentation). 38 | 39 | * Discuss PyYAML with the maintainers on 40 | Matrix at https://matrix.to/#/#pyyaml:yaml.io or 41 | IRC #pyyaml irc.libera.chat 42 | 43 | * Submit bug reports and feature requests to the 44 | [PyYAML bug tracker](https://github.com/yaml/pyyaml/issues). 45 | 46 | ## License 47 | 48 | The PyYAML module was written by Kirill Simonov . 49 | It is currently maintained by the YAML and Python communities. 50 | 51 | PyYAML is released under the MIT license. 52 | 53 | See the file LICENSE for more details. 54 | -------------------------------------------------------------------------------- /lib/_yaml/__init__.py: -------------------------------------------------------------------------------- 1 | # This is a stub package designed to roughly emulate the _yaml 2 | # extension module, which previously existed as a standalone module 3 | # and has been moved into the `yaml` package namespace. 4 | # It does not perfectly mimic its old counterpart, but should get 5 | # close enough for anyone who's relying on it even when they shouldn't. 6 | import yaml 7 | 8 | # in some circumstances, the yaml module we imoprted may be from a different version, so we need 9 | # to tread carefully when poking at it here (it may not have the attributes we expect) 10 | if not getattr(yaml, '__with_libyaml__', False): 11 | from sys import version_info 12 | 13 | exc = ModuleNotFoundError if version_info >= (3, 6) else ImportError 14 | raise exc("No module named '_yaml'") 15 | else: 16 | from yaml._yaml import * 17 | import warnings 18 | warnings.warn( 19 | 'The _yaml extension module is now located at yaml._yaml' 20 | ' and its location is subject to change. To use the' 21 | ' LibYAML-based parser and emitter, import from `yaml`:' 22 | ' `from yaml import CLoader as Loader, CDumper as Dumper`.', 23 | DeprecationWarning 24 | ) 25 | del warnings 26 | # Don't `del yaml` here because yaml is actually an existing 27 | # namespace member of _yaml. 28 | 29 | __name__ = '_yaml' 30 | # If the module is top-level (i.e. not a part of any specific package) 31 | # then the attribute should be set to ''. 32 | # https://docs.python.org/3.8/library/types.html 33 | __package__ = '' 34 | -------------------------------------------------------------------------------- /lib/yaml/loader.py: -------------------------------------------------------------------------------- 1 | 2 | __all__ = ['BaseLoader', 'FullLoader', 'SafeLoader', 'Loader', 'UnsafeLoader'] 3 | 4 | from .reader import * 5 | from .scanner import * 6 | from .parser import * 7 | from .composer import * 8 | from .constructor import * 9 | from .resolver import * 10 | 11 | class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver): 12 | 13 | def __init__(self, stream): 14 | Reader.__init__(self, stream) 15 | Scanner.__init__(self) 16 | Parser.__init__(self) 17 | Composer.__init__(self) 18 | BaseConstructor.__init__(self) 19 | BaseResolver.__init__(self) 20 | 21 | class FullLoader(Reader, Scanner, Parser, Composer, FullConstructor, Resolver): 22 | 23 | def __init__(self, stream): 24 | Reader.__init__(self, stream) 25 | Scanner.__init__(self) 26 | Parser.__init__(self) 27 | Composer.__init__(self) 28 | FullConstructor.__init__(self) 29 | Resolver.__init__(self) 30 | 31 | class SafeLoader(Reader, Scanner, Parser, Composer, SafeConstructor, Resolver): 32 | 33 | def __init__(self, stream): 34 | Reader.__init__(self, stream) 35 | Scanner.__init__(self) 36 | Parser.__init__(self) 37 | Composer.__init__(self) 38 | SafeConstructor.__init__(self) 39 | Resolver.__init__(self) 40 | 41 | class Loader(Reader, Scanner, Parser, Composer, Constructor, Resolver): 42 | 43 | def __init__(self, stream): 44 | Reader.__init__(self, stream) 45 | Scanner.__init__(self) 46 | Parser.__init__(self) 47 | Composer.__init__(self) 48 | Constructor.__init__(self) 49 | Resolver.__init__(self) 50 | 51 | # UnsafeLoader is the same as Loader (which is and was always unsafe on 52 | # untrusted input). Use of either Loader or UnsafeLoader should be rare, since 53 | # FullLoad should be able to load almost all YAML safely. Loader is left intact 54 | # to ensure backwards compatibility. 55 | class UnsafeLoader(Reader, Scanner, Parser, Composer, Constructor, Resolver): 56 | 57 | def __init__(self, stream): 58 | Reader.__init__(self, stream) 59 | Scanner.__init__(self) 60 | Parser.__init__(self) 61 | Composer.__init__(self) 62 | Constructor.__init__(self) 63 | Resolver.__init__(self) 64 | -------------------------------------------------------------------------------- /lib/yaml/nodes.py: -------------------------------------------------------------------------------- 1 | 2 | class Node(object): 3 | def __init__(self, tag, value, start_mark, end_mark): 4 | self.tag = tag 5 | self.value = value 6 | self.start_mark = start_mark 7 | self.end_mark = end_mark 8 | def __repr__(self): 9 | value = self.value 10 | #if isinstance(value, list): 11 | # if len(value) == 0: 12 | # value = '' 13 | # elif len(value) == 1: 14 | # value = '<1 item>' 15 | # else: 16 | # value = '<%d items>' % len(value) 17 | #else: 18 | # if len(value) > 75: 19 | # value = repr(value[:70]+u' ... ') 20 | # else: 21 | # value = repr(value) 22 | value = repr(value) 23 | return '%s(tag=%r, value=%s)' % (self.__class__.__name__, self.tag, value) 24 | 25 | class ScalarNode(Node): 26 | id = 'scalar' 27 | def __init__(self, tag, value, 28 | start_mark=None, end_mark=None, style=None): 29 | self.tag = tag 30 | self.value = value 31 | self.start_mark = start_mark 32 | self.end_mark = end_mark 33 | self.style = style 34 | 35 | class CollectionNode(Node): 36 | def __init__(self, tag, value, 37 | start_mark=None, end_mark=None, flow_style=None): 38 | self.tag = tag 39 | self.value = value 40 | self.start_mark = start_mark 41 | self.end_mark = end_mark 42 | self.flow_style = flow_style 43 | 44 | class SequenceNode(CollectionNode): 45 | id = 'sequence' 46 | 47 | class MappingNode(CollectionNode): 48 | id = 'mapping' 49 | 50 | -------------------------------------------------------------------------------- /packaging/_pyyaml_pep517.py: -------------------------------------------------------------------------------- 1 | import inspect 2 | 3 | 4 | def _bridge_build_meta(): 5 | import functools 6 | import sys 7 | 8 | from setuptools import build_meta 9 | 10 | self_module = sys.modules[__name__] 11 | 12 | for attr_name in build_meta.__all__: 13 | attr_value = getattr(build_meta, attr_name) 14 | if callable(attr_value): 15 | setattr(self_module, attr_name, functools.partial(_expose_config_settings, attr_value)) 16 | 17 | 18 | class ActiveConfigSettings: 19 | _current = {} 20 | 21 | def __init__(self, config_settings): 22 | self._config = config_settings 23 | 24 | def __enter__(self): 25 | type(self)._current = self._config 26 | 27 | def __exit__(self, exc_type, exc_val, exc_tb): 28 | type(self)._current = {} 29 | 30 | @classmethod 31 | def current(cls): 32 | return cls._current 33 | 34 | 35 | def _expose_config_settings(real_method, *args, **kwargs): 36 | from contextlib import nullcontext 37 | import inspect 38 | 39 | sig = inspect.signature(real_method) 40 | boundargs = sig.bind(*args, **kwargs) 41 | 42 | config = boundargs.arguments.get('config_settings') 43 | 44 | ctx = ActiveConfigSettings(config) if config else nullcontext() 45 | 46 | with ctx: 47 | return real_method(*args, **kwargs) 48 | 49 | 50 | _bridge_build_meta() 51 | 52 | -------------------------------------------------------------------------------- /packaging/build/libyaml.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eux 4 | 5 | # ensure the prove testing tool is available 6 | echo "::group::ensure build/test prerequisites" 7 | if ! command -v prove; then 8 | if grep -m 1 alpine /etc/os-release; then 9 | apk add perl-utils 10 | else 11 | echo "prove (perl) testing tool unavailable" 12 | exit 1 13 | fi 14 | fi 15 | echo "::endgroup::" 16 | 17 | # build the requested version of libyaml locally 18 | echo "::group::fetch libyaml ${LIBYAML_REF}" 19 | git config --global advice.detachedHead false 20 | git clone --branch "$LIBYAML_REF" "$LIBYAML_REPO" libyaml 21 | pushd libyaml 22 | git reset --hard "$LIBYAML_REF" 23 | echo "::endgroup::" 24 | 25 | echo "::group::autoconf libyaml w/ static only" 26 | ./bootstrap 27 | # build only a static library- reduces our reliance on auditwheel/delocate magic 28 | ./configure --disable-dependency-tracking --with-pic --enable-shared=no 29 | echo "::endgroup::" 30 | 31 | echo "::group::build libyaml" 32 | make 33 | echo "::endgroup::" 34 | 35 | echo "::group::test built libyaml" 36 | make test-all 37 | echo "::endgroup::" 38 | popd 39 | -------------------------------------------------------------------------------- /packaging/build/smoketest.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import yaml 3 | 4 | 5 | def main(): 6 | # various smoke tests on an installed PyYAML with extension 7 | if not getattr(yaml, '_yaml', None): 8 | raise Exception('C extension is not available at `yaml._yaml`') 9 | 10 | print('embedded libyaml version is {0}'.format(yaml._yaml.get_version_string())) 11 | 12 | for loader, dumper in [(yaml.CLoader, yaml.CDumper), (yaml.Loader, yaml.Dumper)]: 13 | testyaml = 'dude: mar' 14 | loaded = yaml.load(testyaml, Loader=loader) 15 | dumped = yaml.dump(loaded, Dumper=dumper) 16 | if testyaml != dumped.strip(): 17 | raise Exception('roundtrip failed with {0}/{1}'.format(loader, dumper)) 18 | print('smoke test passed for {0}'.format(sys.executable)) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = [ 3 | "setuptools", # FIXME: declare min/max setuptools versions? 4 | "wheel", 5 | "Cython; python_version < '3.13'", 6 | "Cython>=3.0; python_version >= '3.13'" 7 | ] 8 | backend-path = ["packaging"] 9 | build-backend = "_pyyaml_pep517" 10 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/a-nasty-libyaml-bug.loader-error: -------------------------------------------------------------------------------- 1 | [ [ -------------------------------------------------------------------------------- /tests/legacy_tests/data/aliases-cdumper-bug.code: -------------------------------------------------------------------------------- 1 | [ today, today ] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/aliases.events: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | - !DocumentStart 3 | - !SequenceStart 4 | - !Scalar { anchor: 'myanchor', tag: '!mytag', value: 'data' } 5 | - !Alias { anchor: 'myanchor' } 6 | - !SequenceEnd 7 | - !DocumentEnd 8 | - !StreamEnd 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/bool.data: -------------------------------------------------------------------------------- 1 | - yes 2 | - NO 3 | - True 4 | - on 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/bool.detect: -------------------------------------------------------------------------------- 1 | tag:yaml.org,2002:bool 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-binary-py2.code: -------------------------------------------------------------------------------- 1 | { 2 | "canonical": 3 | "GIF89a\x0c\x00\x0c\x00\x84\x00\x00\xff\xff\xf7\xf5\xf5\xee\xe9\xe9\xe5fff\x00\x00\x00\xe7\xe7\xe7^^^\xf3\xf3\xed\x8e\x8e\x8e\xe0\xe0\xe0\x9f\x9f\x9f\x93\x93\x93\xa7\xa7\xa7\x9e\x9e\x9eiiiccc\xa3\xa3\xa3\x84\x84\x84\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9!\xfe\x0eMade with GIMP\x00,\x00\x00\x00\x00\x0c\x00\x0c\x00\x00\x05, \x8e\x810\x9e\xe3@\x14\xe8i\x10\xc4\xd1\x8a\x08\x1c\xcf\x80M$z\xef\xff0\x85p\xb8\xb01f\r\x1b\xce\x01\xc3\x01\x1e\x10' \x82\n\x01\x00;", 4 | "generic": 5 | "GIF89a\x0c\x00\x0c\x00\x84\x00\x00\xff\xff\xf7\xf5\xf5\xee\xe9\xe9\xe5fff\x00\x00\x00\xe7\xe7\xe7^^^\xf3\xf3\xed\x8e\x8e\x8e\xe0\xe0\xe0\x9f\x9f\x9f\x93\x93\x93\xa7\xa7\xa7\x9e\x9e\x9eiiiccc\xa3\xa3\xa3\x84\x84\x84\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9!\xfe\x0eMade with GIMP\x00,\x00\x00\x00\x00\x0c\x00\x0c\x00\x00\x05, \x8e\x810\x9e\xe3@\x14\xe8i\x10\xc4\xd1\x8a\x08\x1c\xcf\x80M$z\xef\xff0\x85p\xb8\xb01f\r\x1b\xce\x01\xc3\x01\x1e\x10' \x82\n\x01\x00;", 6 | "description": "The binary value above is a tiny arrow encoded as a gif image.", 7 | } 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-binary-py2.data: -------------------------------------------------------------------------------- 1 | canonical: !!binary "\ 2 | R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\ 3 | OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\ 4 | +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\ 5 | AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=" 6 | generic: !!binary | 7 | R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5 8 | OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+ 9 | +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC 10 | AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs= 11 | description: 12 | The binary value above is a tiny arrow encoded as a gif image. 13 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-binary-py3.code: -------------------------------------------------------------------------------- 1 | { 2 | "canonical": 3 | b"GIF89a\x0c\x00\x0c\x00\x84\x00\x00\xff\xff\xf7\xf5\xf5\xee\xe9\xe9\xe5fff\x00\x00\x00\xe7\xe7\xe7^^^\xf3\xf3\xed\x8e\x8e\x8e\xe0\xe0\xe0\x9f\x9f\x9f\x93\x93\x93\xa7\xa7\xa7\x9e\x9e\x9eiiiccc\xa3\xa3\xa3\x84\x84\x84\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9!\xfe\x0eMade with GIMP\x00,\x00\x00\x00\x00\x0c\x00\x0c\x00\x00\x05, \x8e\x810\x9e\xe3@\x14\xe8i\x10\xc4\xd1\x8a\x08\x1c\xcf\x80M$z\xef\xff0\x85p\xb8\xb01f\r\x1b\xce\x01\xc3\x01\x1e\x10' \x82\n\x01\x00;", 4 | "generic": 5 | b"GIF89a\x0c\x00\x0c\x00\x84\x00\x00\xff\xff\xf7\xf5\xf5\xee\xe9\xe9\xe5fff\x00\x00\x00\xe7\xe7\xe7^^^\xf3\xf3\xed\x8e\x8e\x8e\xe0\xe0\xe0\x9f\x9f\x9f\x93\x93\x93\xa7\xa7\xa7\x9e\x9e\x9eiiiccc\xa3\xa3\xa3\x84\x84\x84\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9!\xfe\x0eMade with GIMP\x00,\x00\x00\x00\x00\x0c\x00\x0c\x00\x00\x05, \x8e\x810\x9e\xe3@\x14\xe8i\x10\xc4\xd1\x8a\x08\x1c\xcf\x80M$z\xef\xff0\x85p\xb8\xb01f\r\x1b\xce\x01\xc3\x01\x1e\x10' \x82\n\x01\x00;", 6 | "description": "The binary value above is a tiny arrow encoded as a gif image.", 7 | } 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-binary-py3.data: -------------------------------------------------------------------------------- 1 | canonical: !!binary "\ 2 | R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\ 3 | OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\ 4 | +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\ 5 | AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=" 6 | generic: !!binary | 7 | R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5 8 | OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+ 9 | +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC 10 | AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs= 11 | description: 12 | The binary value above is a tiny arrow encoded as a gif image. 13 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-bool.code: -------------------------------------------------------------------------------- 1 | { 2 | "canonical": True, 3 | "answer": False, 4 | "logical": True, 5 | "option": True, 6 | "but": { "y": "is a string", "n": "is a string" }, 7 | } 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-bool.data: -------------------------------------------------------------------------------- 1 | canonical: yes 2 | answer: NO 3 | logical: True 4 | option: on 5 | 6 | 7 | but: 8 | y: is a string 9 | n: is a string 10 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-custom.code: -------------------------------------------------------------------------------- 1 | [ 2 | MyTestClass1(x=1), 3 | MyTestClass1(x=1, y=2, z=3), 4 | MyTestClass2(x=10), 5 | MyTestClass2(x=10, y=20, z=30), 6 | MyTestClass3(x=1), 7 | MyTestClass3(x=1, y=2, z=3), 8 | MyTestClass3(x=1, y=2, z=3), 9 | YAMLObject1(my_parameter='foo', my_another_parameter=[1,2,3]) 10 | ] 11 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-custom.data: -------------------------------------------------------------------------------- 1 | --- 2 | - !tag1 3 | x: 1 4 | - !tag1 5 | x: 1 6 | 'y': 2 7 | z: 3 8 | - !tag2 9 | 10 10 | - !tag2 11 | =: 10 12 | 'y': 20 13 | z: 30 14 | - !tag3 15 | x: 1 16 | - !tag3 17 | x: 1 18 | 'y': 2 19 | z: 3 20 | - !tag3 21 | =: 1 22 | 'y': 2 23 | z: 3 24 | - !foo 25 | my-parameter: foo 26 | my-another-parameter: [1,2,3] 27 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-float.code: -------------------------------------------------------------------------------- 1 | { 2 | "canonical": 685230.15, 3 | "exponential": 685230.15, 4 | "fixed": 685230.15, 5 | "sexagesimal": 685230.15, 6 | "negative infinity": -1e300000, 7 | "not a number": 1e300000/1e300000, 8 | } 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-float.data: -------------------------------------------------------------------------------- 1 | canonical: 6.8523015e+5 2 | exponential: 685.230_15e+03 3 | fixed: 685_230.15 4 | sexagesimal: 190:20:30.15 5 | negative infinity: -.inf 6 | not a number: .NaN 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-int.code: -------------------------------------------------------------------------------- 1 | { 2 | "canonical": 685230, 3 | "decimal": 685230, 4 | "octal": 685230, 5 | "hexadecimal": 685230, 6 | "binary": 685230, 7 | "sexagesimal": 685230, 8 | } 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-int.data: -------------------------------------------------------------------------------- 1 | canonical: 685230 2 | decimal: +685_230 3 | octal: 02472256 4 | hexadecimal: 0x_0A_74_AE 5 | binary: 0b1010_0111_0100_1010_1110 6 | sexagesimal: 190:20:30 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-map.code: -------------------------------------------------------------------------------- 1 | { 2 | "Block style": 3 | { "Clark" : "Evans", "Brian" : "Ingerson", "Oren" : "Ben-Kiki" }, 4 | "Flow style": 5 | { "Clark" : "Evans", "Brian" : "Ingerson", "Oren" : "Ben-Kiki" }, 6 | } 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-map.data: -------------------------------------------------------------------------------- 1 | # Unordered set of key: value pairs. 2 | Block style: !!map 3 | Clark : Evans 4 | Brian : Ingerson 5 | Oren : Ben-Kiki 6 | Flow style: !!map { Clark: Evans, Brian: Ingerson, Oren: Ben-Kiki } 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-merge.code: -------------------------------------------------------------------------------- 1 | [ 2 | { "x": 1, "y": 2 }, 3 | { "x": 0, "y": 2 }, 4 | { "r": 10 }, 5 | { "r": 1 }, 6 | { "x": 1, "y": 2, "r": 10, "label": "center/big" }, 7 | { "x": 1, "y": 2, "r": 10, "label": "center/big" }, 8 | { "x": 1, "y": 2, "r": 10, "label": "center/big" }, 9 | { "x": 1, "y": 2, "r": 10, "label": "center/big" }, 10 | ] 11 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-merge.data: -------------------------------------------------------------------------------- 1 | --- 2 | - &CENTER { x: 1, 'y': 2 } 3 | - &LEFT { x: 0, 'y': 2 } 4 | - &BIG { r: 10 } 5 | - &SMALL { r: 1 } 6 | 7 | # All the following maps are equal: 8 | 9 | - # Explicit keys 10 | x: 1 11 | 'y': 2 12 | r: 10 13 | label: center/big 14 | 15 | - # Merge one map 16 | << : *CENTER 17 | r: 10 18 | label: center/big 19 | 20 | - # Merge multiple maps 21 | << : [ *CENTER, *BIG ] 22 | label: center/big 23 | 24 | - # Override 25 | << : [ *BIG, *LEFT, *SMALL ] 26 | x: 1 27 | label: center/big 28 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-null.code: -------------------------------------------------------------------------------- 1 | [ 2 | None, 3 | { "empty": None, "canonical": None, "english": None, None: "null key" }, 4 | { 5 | "sparse": [ 6 | None, 7 | "2nd entry", 8 | None, 9 | "4th entry", 10 | None, 11 | ], 12 | }, 13 | ] 14 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-null.data: -------------------------------------------------------------------------------- 1 | # A document may be null. 2 | --- 3 | --- 4 | # This mapping has four keys, 5 | # one has a value. 6 | empty: 7 | canonical: ~ 8 | english: null 9 | ~: null key 10 | --- 11 | # This sequence has five 12 | # entries, two have values. 13 | sparse: 14 | - ~ 15 | - 2nd entry 16 | - 17 | - 4th entry 18 | - Null 19 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-omap.code: -------------------------------------------------------------------------------- 1 | { 2 | "Bestiary": [ 3 | ("aardvark", "African pig-like ant eater. Ugly."), 4 | ("anteater", "South-American ant eater. Two species."), 5 | ("anaconda", "South-American constrictor snake. Scaly."), 6 | ], 7 | "Numbers": [ ("one", 1), ("two", 2), ("three", 3) ], 8 | } 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-omap.data: -------------------------------------------------------------------------------- 1 | # Explicitly typed ordered map (dictionary). 2 | Bestiary: !!omap 3 | - aardvark: African pig-like ant eater. Ugly. 4 | - anteater: South-American ant eater. Two species. 5 | - anaconda: South-American constrictor snake. Scaly. 6 | # Etc. 7 | # Flow style 8 | Numbers: !!omap [ one: 1, two: 2, three : 3 ] 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-pairs.code: -------------------------------------------------------------------------------- 1 | { 2 | "Block tasks": [ 3 | ("meeting", "with team."), 4 | ("meeting", "with boss."), 5 | ("break", "lunch."), 6 | ("meeting", "with client."), 7 | ], 8 | "Flow tasks": [ ("meeting", "with team"), ("meeting", "with boss") ], 9 | } 10 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-pairs.data: -------------------------------------------------------------------------------- 1 | # Explicitly typed pairs. 2 | Block tasks: !!pairs 3 | - meeting: with team. 4 | - meeting: with boss. 5 | - break: lunch. 6 | - meeting: with client. 7 | Flow tasks: !!pairs [ meeting: with team, meeting: with boss ] 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-bool.code: -------------------------------------------------------------------------------- 1 | [ True, False ] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-bool.data: -------------------------------------------------------------------------------- 1 | [ !!python/bool True, !!python/bool False ] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-bytes-py3.code: -------------------------------------------------------------------------------- 1 | b'some binary data' 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-bytes-py3.data: -------------------------------------------------------------------------------- 1 | --- !!python/bytes 'c29tZSBiaW5hcnkgZGF0YQ==' 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-complex.code: -------------------------------------------------------------------------------- 1 | [0.5+0j, 0.5+0.5j, 0.5j, -0.5+0.5j, -0.5+0j, -0.5-0.5j, -0.5j, 0.5-0.5j] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-complex.data: -------------------------------------------------------------------------------- 1 | - !!python/complex 0.5+0j 2 | - !!python/complex 0.5+0.5j 3 | - !!python/complex 0.5j 4 | - !!python/complex -0.5+0.5j 5 | - !!python/complex -0.5+0j 6 | - !!python/complex -0.5-0.5j 7 | - !!python/complex -0.5j 8 | - !!python/complex 0.5-0.5j 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-float.code: -------------------------------------------------------------------------------- 1 | 123.456 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-float.data: -------------------------------------------------------------------------------- 1 | !!python/float 123.456 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-int.code: -------------------------------------------------------------------------------- 1 | 123 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-int.data: -------------------------------------------------------------------------------- 1 | !!python/int 123 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-long-short-py2.code: -------------------------------------------------------------------------------- 1 | 123L 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-long-short-py2.data: -------------------------------------------------------------------------------- 1 | !!python/long 123 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-long-short-py3.code: -------------------------------------------------------------------------------- 1 | 123 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-long-short-py3.data: -------------------------------------------------------------------------------- 1 | !!python/long 123 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-name-module.code: -------------------------------------------------------------------------------- 1 | [str, yaml.Loader, yaml.dump, abs, yaml.tokens, signal.Handlers] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-name-module.data: -------------------------------------------------------------------------------- 1 | - !!python/name:str 2 | - !!python/name:yaml.Loader 3 | - !!python/name:yaml.dump 4 | - !!python/name:abs 5 | - !!python/module:yaml.tokens 6 | - !!python/name:signal.Handlers 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-none.code: -------------------------------------------------------------------------------- 1 | None 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-none.data: -------------------------------------------------------------------------------- 1 | !!python/none 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-object.code: -------------------------------------------------------------------------------- 1 | [ 2 | AnObject(1, 'two', [3,3,3]), 3 | AnInstance(1, 'two', [3,3,3]), 4 | 5 | AnObject(1, 'two', [3,3,3]), 6 | AnInstance(1, 'two', [3,3,3]), 7 | 8 | AState(1, 'two', [3,3,3]), 9 | ACustomState(1, 'two', [3,3,3]), 10 | 11 | InitArgs(1, 'two', [3,3,3]), 12 | InitArgsWithState(1, 'two', [3,3,3]), 13 | 14 | NewArgs(1, 'two', [3,3,3]), 15 | NewArgsWithState(1, 'two', [3,3,3]), 16 | 17 | Reduce(1, 'two', [3,3,3]), 18 | ReduceWithState(1, 'two', [3,3,3]), 19 | 20 | Slots(1, 'two', [3,3,3]), 21 | 22 | MyInt(3), 23 | MyList(3), 24 | MyDict(3), 25 | ] 26 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-object.data: -------------------------------------------------------------------------------- 1 | - !!python/object:test_constructor.AnObject { foo: 1, bar: two, baz: [3,3,3] } 2 | - !!python/object:test_constructor.AnInstance { foo: 1, bar: two, baz: [3,3,3] } 3 | 4 | - !!python/object/new:test_constructor.AnObject { args: [1, two], kwds: {baz: [3,3,3]} } 5 | - !!python/object/apply:test_constructor.AnInstance { args: [1, two], kwds: {baz: [3,3,3]} } 6 | 7 | - !!python/object:test_constructor.AState { _foo: 1, _bar: two, _baz: [3,3,3] } 8 | - !!python/object/new:test_constructor.ACustomState { state: !!python/tuple [1, two, [3,3,3]] } 9 | 10 | - !!python/object/new:test_constructor.InitArgs [1, two, [3,3,3]] 11 | - !!python/object/new:test_constructor.InitArgsWithState { args: [1, two], state: [3,3,3] } 12 | 13 | - !!python/object/new:test_constructor.NewArgs [1, two, [3,3,3]] 14 | - !!python/object/new:test_constructor.NewArgsWithState { args: [1, two], state: [3,3,3] } 15 | 16 | - !!python/object/apply:test_constructor.Reduce [1, two, [3,3,3]] 17 | - !!python/object/apply:test_constructor.ReduceWithState { args: [1, two], state: [3,3,3] } 18 | 19 | - !!python/object/new:test_constructor.Slots { state: !!python/tuple [null, { foo: 1, bar: 'two', baz: [3,3,3] } ] } 20 | 21 | - !!python/object/new:test_constructor.MyInt [3] 22 | - !!python/object/new:test_constructor.MyList { listitems: [~, ~, ~] } 23 | - !!python/object/new:test_constructor.MyDict { dictitems: {0, 1, 2} } 24 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-str-ascii.code: -------------------------------------------------------------------------------- 1 | "ascii string" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-str-ascii.data: -------------------------------------------------------------------------------- 1 | --- !!python/str "ascii string" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-str-utf8-py2.code: -------------------------------------------------------------------------------- 1 | u'\u042d\u0442\u043e \u0443\u043d\u0438\u043a\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430'.encode('utf-8') 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-str-utf8-py2.data: -------------------------------------------------------------------------------- 1 | --- !!python/str "Это уникодная строка" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-str-utf8-py3.code: -------------------------------------------------------------------------------- 1 | '\u042d\u0442\u043e \u0443\u043d\u0438\u043a\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430' 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-str-utf8-py3.data: -------------------------------------------------------------------------------- 1 | --- !!python/str "Это уникодная строка" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-tuple-list-dict.code: -------------------------------------------------------------------------------- 1 | [ 2 | [1, 2, 3, 4], 3 | (1, 2, 3, 4), 4 | {1: 2, 3: 4}, 5 | {(0,0): 0, (0,1): 1, (1,0): 1, (1,1): 0}, 6 | ] 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-tuple-list-dict.data: -------------------------------------------------------------------------------- 1 | - !!python/list [1, 2, 3, 4] 2 | - !!python/tuple [1, 2, 3, 4] 3 | - !!python/dict {1: 2, 3: 4} 4 | - !!python/dict 5 | !!python/tuple [0,0]: 0 6 | !!python/tuple [0,1]: 1 7 | !!python/tuple [1,0]: 1 8 | !!python/tuple [1,1]: 0 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-unicode-ascii-py2.code: -------------------------------------------------------------------------------- 1 | u"ascii string" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-unicode-ascii-py2.data: -------------------------------------------------------------------------------- 1 | --- !!python/unicode "ascii string" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-unicode-ascii-py3.code: -------------------------------------------------------------------------------- 1 | "ascii string" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-unicode-ascii-py3.data: -------------------------------------------------------------------------------- 1 | --- !!python/unicode "ascii string" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-unicode-utf8-py2.code: -------------------------------------------------------------------------------- 1 | u'\u042d\u0442\u043e \u0443\u043d\u0438\u043a\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430' 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-unicode-utf8-py2.data: -------------------------------------------------------------------------------- 1 | --- !!python/unicode "Это уникодная строка" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-unicode-utf8-py3.code: -------------------------------------------------------------------------------- 1 | '\u042d\u0442\u043e \u0443\u043d\u0438\u043a\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430' 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-python-unicode-utf8-py3.data: -------------------------------------------------------------------------------- 1 | --- !!python/unicode "Это уникодная строка" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-seq.code: -------------------------------------------------------------------------------- 1 | { 2 | "Block style": ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto"], 3 | "Flow style": ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto"], 4 | } 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-seq.data: -------------------------------------------------------------------------------- 1 | # Ordered sequence of nodes 2 | Block style: !!seq 3 | - Mercury # Rotates - no light/dark sides. 4 | - Venus # Deadliest. Aptly named. 5 | - Earth # Mostly dirt. 6 | - Mars # Seems empty. 7 | - Jupiter # The king. 8 | - Saturn # Pretty. 9 | - Uranus # Where the sun hardly shines. 10 | - Neptune # Boring. No rings. 11 | - Pluto # You call this a planet? 12 | Flow style: !!seq [ Mercury, Venus, Earth, Mars, # Rocks 13 | Jupiter, Saturn, Uranus, Neptune, # Gas 14 | Pluto ] # Overrated 15 | 16 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-set.code: -------------------------------------------------------------------------------- 1 | { 2 | "baseball players": set(["Mark McGwire", "Sammy Sosa", "Ken Griffey"]), 3 | "baseball teams": set(["Boston Red Sox", "Detroit Tigers", "New York Yankees"]), 4 | } 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-set.data: -------------------------------------------------------------------------------- 1 | # Explicitly typed set. 2 | baseball players: !!set 3 | ? Mark McGwire 4 | ? Sammy Sosa 5 | ? Ken Griffey 6 | # Flow style 7 | baseball teams: !!set { Boston Red Sox, Detroit Tigers, New York Yankees } 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-str-ascii.code: -------------------------------------------------------------------------------- 1 | "ascii string" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-str-ascii.data: -------------------------------------------------------------------------------- 1 | --- !!str "ascii string" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-str-utf8-py2.code: -------------------------------------------------------------------------------- 1 | u'\u042d\u0442\u043e \u0443\u043d\u0438\u043a\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430' 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-str-utf8-py2.data: -------------------------------------------------------------------------------- 1 | --- !!str "Это уникодная строка" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-str-utf8-py3.code: -------------------------------------------------------------------------------- 1 | '\u042d\u0442\u043e \u0443\u043d\u0438\u043a\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430' 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-str-utf8-py3.data: -------------------------------------------------------------------------------- 1 | --- !!str "Это уникодная строка" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-str.code: -------------------------------------------------------------------------------- 1 | { "string": "abcd" } 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-str.data: -------------------------------------------------------------------------------- 1 | string: abcd 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-timestamp.code: -------------------------------------------------------------------------------- 1 | { 2 | "canonical": datetime.datetime(2001, 12, 15, 2, 59, 43, 100000), 3 | "valid iso8601": datetime.datetime(2001, 12, 15, 2, 59, 43, 100000), 4 | "space separated": datetime.datetime(2001, 12, 15, 2, 59, 43, 100000), 5 | "no time zone (Z)": datetime.datetime(2001, 12, 15, 2, 59, 43, 100000), 6 | "date (00:00:00Z)": datetime.date(2002, 12, 14), 7 | } 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-timestamp.data: -------------------------------------------------------------------------------- 1 | canonical: 2001-12-15T02:59:43.1Z 2 | valid iso8601: 2001-12-14t21:59:43.10-05:00 3 | space separated: 2001-12-14 21:59:43.10 -5 4 | no time zone (Z): 2001-12-15 2:59:43.10 5 | date (00:00:00Z): 2002-12-14 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-value.code: -------------------------------------------------------------------------------- 1 | [ 2 | { "link with": [ "library1.dll", "library2.dll" ] }, 3 | { 4 | "link with": [ 5 | { "=": "library1.dll", "version": 1.2 }, 6 | { "=": "library2.dll", "version": 2.3 }, 7 | ], 8 | }, 9 | ] 10 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/construct-value.data: -------------------------------------------------------------------------------- 1 | --- # Old schema 2 | link with: 3 | - library1.dll 4 | - library2.dll 5 | --- # New schema 6 | link with: 7 | - = : library1.dll 8 | version: 1.2 9 | - = : library2.dll 10 | version: 2.3 11 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/document-separator-in-quoted-scalar.loader-error: -------------------------------------------------------------------------------- 1 | --- 2 | "this --- is correct" 3 | --- 4 | "this 5 | ...is also 6 | correct" 7 | --- 8 | "a quoted scalar 9 | cannot contain 10 | --- 11 | document separators" 12 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/documents.events: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | - !DocumentStart { explicit: false } 3 | - !Scalar { implicit: [true,false], value: 'data' } 4 | - !DocumentEnd 5 | - !DocumentStart 6 | - !Scalar { implicit: [true,false] } 7 | - !DocumentEnd 8 | - !DocumentStart { version: [1,1], tags: { '!': '!foo', '!yaml!': 'tag:yaml.org,2002:', '!ugly!': '!!!!!!!' } } 9 | - !Scalar { implicit: [true,false] } 10 | - !DocumentEnd 11 | - !StreamEnd 12 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/duplicate-anchor-1.loader-error: -------------------------------------------------------------------------------- 1 | - &foo bar 2 | - &bar bar 3 | - &foo bar 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/duplicate-anchor-2.loader-error: -------------------------------------------------------------------------------- 1 | &foo [1, 2, 3, &foo 4] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/duplicate-key.former-loader-error.code: -------------------------------------------------------------------------------- 1 | { 'foo': 'baz' } 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/duplicate-key.former-loader-error.data: -------------------------------------------------------------------------------- 1 | --- 2 | foo: bar 3 | foo: baz 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/duplicate-mapping-key.former-loader-error.code: -------------------------------------------------------------------------------- 1 | { 'foo': { 'baz': 'bat', 'foo': 'duplicate key' } } 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/duplicate-mapping-key.former-loader-error.data: -------------------------------------------------------------------------------- 1 | --- 2 | &anchor foo: 3 | foo: bar 4 | *anchor: duplicate key 5 | baz: bat 6 | *anchor: duplicate key 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/duplicate-merge-key.former-loader-error.code: -------------------------------------------------------------------------------- 1 | { 'x': 1, 'y': 2, 'foo': 'bar', 'z': 3, 't': 4 } 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/duplicate-merge-key.former-loader-error.data: -------------------------------------------------------------------------------- 1 | --- 2 | <<: {x: 1, y: 2} 3 | foo: bar 4 | <<: {z: 3, t: 4} 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/duplicate-tag-directive.loader-error: -------------------------------------------------------------------------------- 1 | %TAG !foo! bar 2 | %TAG !foo! baz 3 | --- foo 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/duplicate-value-key.former-loader-error.code: -------------------------------------------------------------------------------- 1 | { 'foo': 'bar', '=': 2 } 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/duplicate-value-key.former-loader-error.data: -------------------------------------------------------------------------------- 1 | --- 2 | =: 1 3 | foo: bar 4 | =: 2 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/duplicate-yaml-directive.loader-error: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %YAML 1.1 3 | --- foo 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/emit-block-scalar-in-simple-key-context-bug.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- !!map 3 | { 4 | ? !!str "foo" 5 | : !!str "bar" 6 | } 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/emit-block-scalar-in-simple-key-context-bug.data: -------------------------------------------------------------------------------- 1 | ? |- 2 | foo 3 | : |- 4 | bar 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/emitting-unacceptable-unicode-character-bug-py3.code: -------------------------------------------------------------------------------- 1 | "\udd00" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/emitting-unacceptable-unicode-character-bug-py3.data: -------------------------------------------------------------------------------- 1 | "\udd00" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/emitting-unacceptable-unicode-character-bug-py3.skip-ext: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaml/pyyaml/69c141adcf805c5ebdc9ba519927642ee5c7f639/tests/legacy_tests/data/emitting-unacceptable-unicode-character-bug-py3.skip-ext -------------------------------------------------------------------------------- /tests/legacy_tests/data/emitting-unacceptable-unicode-character-bug.code: -------------------------------------------------------------------------------- 1 | u"\udd00" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/emitting-unacceptable-unicode-character-bug.data: -------------------------------------------------------------------------------- 1 | "\udd00" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/emitting-unacceptable-unicode-character-bug.skip-ext: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaml/pyyaml/69c141adcf805c5ebdc9ba519927642ee5c7f639/tests/legacy_tests/data/emitting-unacceptable-unicode-character-bug.skip-ext -------------------------------------------------------------------------------- /tests/legacy_tests/data/emoticons.unicode: -------------------------------------------------------------------------------- 1 | 😀😁😂😃😄😅😆😇 2 | 😈😉😊😋😌😍😎😏 3 | 😐😑😒😓😔😕😖😗 4 | 😘😙😚😛😜😝😞😟 5 | 😠😡😢😣😤😥😦😧 6 | 😨😩😪😫😬😭😮😯 7 | 😰😱😲😳😴😵😶😷 8 | 😸😹😺😻😼😽😾😿 9 | 🙀🙁🙂🙃🙄🙅🙆🙇 10 | 🙈🙉🙊🙋🙌🙍🙎🙏 11 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/emoticons2.unicode: -------------------------------------------------------------------------------- 1 | 😀 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/empty-anchor.emitter-error: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | - !DocumentStart 3 | - !Scalar { anchor: '', value: 'foo' } 4 | - !DocumentEnd 5 | - !StreamEnd 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/empty-document-bug.canonical: -------------------------------------------------------------------------------- 1 | # This YAML stream contains no YAML documents. 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/empty-document-bug.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaml/pyyaml/69c141adcf805c5ebdc9ba519927642ee5c7f639/tests/legacy_tests/data/empty-document-bug.data -------------------------------------------------------------------------------- /tests/legacy_tests/data/empty-document-bug.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaml/pyyaml/69c141adcf805c5ebdc9ba519927642ee5c7f639/tests/legacy_tests/data/empty-document-bug.empty -------------------------------------------------------------------------------- /tests/legacy_tests/data/empty-documents.single-loader-error: -------------------------------------------------------------------------------- 1 | --- # first document 2 | --- # second document 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/empty-python-module.loader-error: -------------------------------------------------------------------------------- 1 | --- !!python:module: 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/empty-python-name.loader-error: -------------------------------------------------------------------------------- 1 | --- !!python/name: empty 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/empty-tag-handle.emitter-error: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | - !DocumentStart { tags: { '': 'bar' } } 3 | - !Scalar { value: 'foo' } 4 | - !DocumentEnd 5 | - !StreamEnd 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/empty-tag-prefix.emitter-error: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | - !DocumentStart { tags: { '!': '' } } 3 | - !Scalar { value: 'foo' } 4 | - !DocumentEnd 5 | - !StreamEnd 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/empty-tag.emitter-error: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | - !DocumentStart 3 | - !Scalar { tag: '', value: 'key', implicit: [false,false] } 4 | - !DocumentEnd 5 | - !StreamEnd 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/expected-document-end.emitter-error: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | - !DocumentStart 3 | - !Scalar { value: 'data 1' } 4 | - !Scalar { value: 'data 2' } 5 | - !DocumentEnd 6 | - !StreamEnd 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/expected-document-start.emitter-error: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | - !MappingStart 3 | - !MappingEnd 4 | - !StreamEnd 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/expected-mapping.loader-error: -------------------------------------------------------------------------------- 1 | --- !!map [not, a, map] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/expected-node-1.emitter-error: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | - !DocumentStart 3 | - !DocumentEnd 4 | - !StreamEnd 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/expected-node-2.emitter-error: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | - !DocumentStart 3 | - !MappingStart 4 | - !Scalar { value: 'key' } 5 | - !MappingEnd 6 | - !DocumentEnd 7 | - !StreamEnd 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/expected-nothing.emitter-error: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | - !StreamEnd 3 | - !StreamStart 4 | - !StreamEnd 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/expected-scalar.loader-error: -------------------------------------------------------------------------------- 1 | --- !!str [not a scalar] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/expected-sequence.loader-error: -------------------------------------------------------------------------------- 1 | --- !!seq {foo, bar, baz} 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/expected-stream-start.emitter-error: -------------------------------------------------------------------------------- 1 | - !DocumentStart 2 | - !DocumentEnd 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/explicit-document.single-loader-error: -------------------------------------------------------------------------------- 1 | --- 2 | foo: bar 3 | --- 4 | foo: bar 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/fetch-complex-value-bug.loader-error: -------------------------------------------------------------------------------- 1 | ? "foo" 2 | : "bar" 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/float-representer-2.3-bug.code: -------------------------------------------------------------------------------- 1 | { 2 | # 0.0: 0, 3 | 1.0: 1, 4 | 1e300000: +10, 5 | -1e300000: -10, 6 | 1e300000/1e300000: 100, 7 | } 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/float-representer-2.3-bug.data: -------------------------------------------------------------------------------- 1 | #0.0: # hash(0) == hash(nan) and 0 == nan in Python 2.3 2 | 1.0: 1 3 | +.inf: 10 4 | -.inf: -10 5 | .nan: 100 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/float.data: -------------------------------------------------------------------------------- 1 | - 6.8523015e+5 2 | - 685.230_15e+03 3 | - 685_230.15 4 | - 190:20:30.15 5 | - -.inf 6 | - .NaN 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/float.detect: -------------------------------------------------------------------------------- 1 | tag:yaml.org,2002:float 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/forbidden-entry.loader-error: -------------------------------------------------------------------------------- 1 | test: - foo 2 | - bar 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/forbidden-key.loader-error: -------------------------------------------------------------------------------- 1 | test: ? foo 2 | : bar 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/forbidden-value.loader-error: -------------------------------------------------------------------------------- 1 | test: key: value 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/implicit-document.single-loader-error: -------------------------------------------------------------------------------- 1 | foo: bar 2 | --- 3 | foo: bar 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/int.data: -------------------------------------------------------------------------------- 1 | - 685230 2 | - +685_230 3 | - 02472256 4 | - 0x_0A_74_AE 5 | - 0b1010_0111_0100_1010_1110 6 | - 190:20:30 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/int.detect: -------------------------------------------------------------------------------- 1 | tag:yaml.org,2002:int 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-anchor-1.loader-error: -------------------------------------------------------------------------------- 1 | --- &? foo # we allow only ascii and numeric characters in anchor names. 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-anchor-2.loader-error: -------------------------------------------------------------------------------- 1 | --- 2 | - [ 3 | &correct foo, 4 | *correct, 5 | *correct] # still correct 6 | - *correct: still correct 7 | - &correct-or-not[foo, bar] 8 | 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-anchor.emitter-error: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | - !DocumentStart 3 | - !Scalar { anchor: '5*5=25', value: 'foo' } 4 | - !DocumentEnd 5 | - !StreamEnd 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-base64-data-2.loader-error: -------------------------------------------------------------------------------- 1 | --- !!binary 2 | двоичные данные в base64 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-base64-data.loader-error: -------------------------------------------------------------------------------- 1 | --- !!binary 2 | binary data encoded in base64 should be here. 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-block-scalar-indicator.loader-error: -------------------------------------------------------------------------------- 1 | --- > what is this? # a comment 2 | data 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-character.loader-error: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------------------------------------------------------- 2 | ------------------------------------------------------------------------------------------------------------------------------- 3 | ------------------------------------------------------------------------------------------------------------------------------- 4 | ------------------------------------------------------------------------------------------------------------------------------- 5 | ------------------------------------------------------------------------------------------------------------------------------- 6 | ------------------------------------------------------------------------------------------------------------------------------- 7 | ------------------------------------------------------------------------------------------------------------------------------- 8 | ------------------------------------------------------------------------------------------------------------------------------- 9 | ------------------------------------------------------------------------------------------------------------------------------- 10 | ------------------------------------------------------------------------------------------------------------------------------- 11 | ------------------------------------------------------------------------------------------------------------------------------- 12 | ------------------------------------------------------------------------------------------------------------------------------- 13 | ------------------------------------------------------------------------------------------------------------------------------- 14 | ------------------------------------------------------------------------------------------------------------------------------- 15 | ------------------------------------------------------------------------------------------------------------------------------- 16 | ------------------------------------------------------------------------------------------------------------------------------- 17 | Control character ('\x0'): <-- 18 | ------------------------------------------------------------------------------------------------------------------------------- 19 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-directive-line.loader-error: -------------------------------------------------------------------------------- 1 | %YAML 1.1 ? # extra symbol 2 | --- 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-directive-name-1.loader-error: -------------------------------------------------------------------------------- 1 | % # no name at all 2 | --- 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-directive-name-2.loader-error: -------------------------------------------------------------------------------- 1 | %invalid-characters:in-directive name 2 | --- 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-escape-character.loader-error: -------------------------------------------------------------------------------- 1 | "some escape characters are \ncorrect, but this one \?\nis not\n" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-escape-numbers.loader-error: -------------------------------------------------------------------------------- 1 | "hm.... \u123?" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-indentation-indicator-1.loader-error: -------------------------------------------------------------------------------- 1 | --- >0 # not valid 2 | data 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-indentation-indicator-2.loader-error: -------------------------------------------------------------------------------- 1 | --- >-0 2 | data 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-item-without-trailing-break.loader-error: -------------------------------------------------------------------------------- 1 | - 2 | -0 -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-merge-1.loader-error: -------------------------------------------------------------------------------- 1 | foo: bar 2 | <<: baz 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-merge-2.loader-error: -------------------------------------------------------------------------------- 1 | foo: bar 2 | <<: [x: 1, y: 2, z, t: 4] 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-omap-1.loader-error: -------------------------------------------------------------------------------- 1 | --- !!omap 2 | foo: bar 3 | baz: bat 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-omap-2.loader-error: -------------------------------------------------------------------------------- 1 | --- !!omap 2 | - foo: bar 3 | - baz 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-omap-3.loader-error: -------------------------------------------------------------------------------- 1 | --- !!omap 2 | - foo: bar 3 | - baz: bar 4 | bar: bar 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-pairs-1.loader-error: -------------------------------------------------------------------------------- 1 | --- !!pairs 2 | foo: bar 3 | baz: bat 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-pairs-2.loader-error: -------------------------------------------------------------------------------- 1 | --- !!pairs 2 | - foo: bar 3 | - baz 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-pairs-3.loader-error: -------------------------------------------------------------------------------- 1 | --- !!pairs 2 | - foo: bar 3 | - baz: bar 4 | bar: bar 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-python-bytes-2-py3.loader-error: -------------------------------------------------------------------------------- 1 | --- !!python/bytes 2 | двоичные данные в base64 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-python-bytes-py3.loader-error: -------------------------------------------------------------------------------- 1 | --- !!python/bytes 2 | binary data encoded in base64 should be here. 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-python-module-kind.loader-error: -------------------------------------------------------------------------------- 1 | --- !!python/module:sys { must, be, scalar } 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-python-module-value.loader-error: -------------------------------------------------------------------------------- 1 | --- !!python/module:sys "non-empty value" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-python-module.loader-error: -------------------------------------------------------------------------------- 1 | --- !!python/module:no.such.module 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-python-name-kind.loader-error: -------------------------------------------------------------------------------- 1 | --- !!python/name:sys.modules {} 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-python-name-module.loader-error: -------------------------------------------------------------------------------- 1 | --- !!python/name:sys.modules.keys 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-python-name-object.loader-error: -------------------------------------------------------------------------------- 1 | --- !!python/name:os.path.rm_rf 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-python-name-value.loader-error: -------------------------------------------------------------------------------- 1 | --- !!python/name:sys.modules 5 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-simple-key.loader-error: -------------------------------------------------------------------------------- 1 | key: value 2 | invalid simple key 3 | next key: next value 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-single-quote-bug.code: -------------------------------------------------------------------------------- 1 | ["foo 'bar'", "foo\n'bar'"] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-single-quote-bug.data: -------------------------------------------------------------------------------- 1 | - "foo 'bar'" 2 | - "foo\n'bar'" 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-starting-character.loader-error: -------------------------------------------------------------------------------- 1 | @@@@@@@@@@@@@@@@@@@ 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-tag-1.loader-error: -------------------------------------------------------------------------------- 1 | - ! baz 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-tag-2.loader-error: -------------------------------------------------------------------------------- 1 | - !prefix!foo#bar baz 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-tag-directive-handle.loader-error: -------------------------------------------------------------------------------- 1 | %TAG !!! !!! 2 | --- 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-tag-directive-prefix.loader-error: -------------------------------------------------------------------------------- 1 | %TAG ! tag:zz.com/foo#bar # '#' is not allowed in URLs 2 | --- 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-tag-handle-1.emitter-error: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | - !DocumentStart { tags: { '!foo': 'bar' } } 3 | - !Scalar { value: 'foo' } 4 | - !DocumentEnd 5 | - !StreamEnd 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-tag-handle-1.loader-error: -------------------------------------------------------------------------------- 1 | %TAG foo bar 2 | --- 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-tag-handle-2.emitter-error: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | - !DocumentStart { tags: { '!!!': 'bar' } } 3 | - !Scalar { value: 'foo' } 4 | - !DocumentEnd 5 | - !StreamEnd 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-tag-handle-2.loader-error: -------------------------------------------------------------------------------- 1 | %TAG !foo bar 2 | --- 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-uri-escapes-1.loader-error: -------------------------------------------------------------------------------- 1 | --- ! foo 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-uri-escapes-2.loader-error: -------------------------------------------------------------------------------- 1 | --- !<%FF> foo 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-uri-escapes-3.loader-error: -------------------------------------------------------------------------------- 1 | --- ! baz 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-uri.loader-error: -------------------------------------------------------------------------------- 1 | --- !foo! bar 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-utf8-byte.loader-error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaml/pyyaml/69c141adcf805c5ebdc9ba519927642ee5c7f639/tests/legacy_tests/data/invalid-utf8-byte.loader-error -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-utf8-byte.stream-error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaml/pyyaml/69c141adcf805c5ebdc9ba519927642ee5c7f639/tests/legacy_tests/data/invalid-utf8-byte.stream-error -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-yaml-directive-version-1.loader-error: -------------------------------------------------------------------------------- 1 | # No version at all. 2 | %YAML 3 | --- 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-yaml-directive-version-2.loader-error: -------------------------------------------------------------------------------- 1 | %YAML 1e-5 2 | --- 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-yaml-directive-version-3.loader-error: -------------------------------------------------------------------------------- 1 | %YAML 1. 2 | --- 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-yaml-directive-version-4.loader-error: -------------------------------------------------------------------------------- 1 | %YAML 1.132.435 2 | --- 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-yaml-directive-version-5.loader-error: -------------------------------------------------------------------------------- 1 | %YAML A.0 2 | --- 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-yaml-directive-version-6.loader-error: -------------------------------------------------------------------------------- 1 | %YAML 123.C 2 | --- 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/invalid-yaml-version.loader-error: -------------------------------------------------------------------------------- 1 | %YAML 2.0 2 | --- foo 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/mapping.sort: -------------------------------------------------------------------------------- 1 | z: 1 2 | a: 2 3 | y: 3 4 | b: 4 5 | x: 5 6 | c: 6 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/mapping.sorted: -------------------------------------------------------------------------------- 1 | a: 2 2 | b: 4 3 | c: 6 4 | x: 5 5 | y: 3 6 | z: 1 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/mappings.events: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | 3 | - !DocumentStart 4 | - !MappingStart 5 | - !Scalar { implicit: [true,true], value: 'key' } 6 | - !Scalar { implicit: [true,true], value: 'value' } 7 | - !Scalar { implicit: [true,true], value: 'empty mapping' } 8 | - !MappingStart 9 | - !MappingEnd 10 | - !Scalar { implicit: [true,true], value: 'empty mapping with tag' } 11 | - !MappingStart { tag: '!mytag', implicit: false } 12 | - !MappingEnd 13 | - !Scalar { implicit: [true,true], value: 'block mapping' } 14 | - !MappingStart 15 | - !MappingStart 16 | - !Scalar { implicit: [true,true], value: 'complex' } 17 | - !Scalar { implicit: [true,true], value: 'key' } 18 | - !Scalar { implicit: [true,true], value: 'complex' } 19 | - !Scalar { implicit: [true,true], value: 'key' } 20 | - !MappingEnd 21 | - !MappingStart 22 | - !Scalar { implicit: [true,true], value: 'complex' } 23 | - !Scalar { implicit: [true,true], value: 'key' } 24 | - !MappingEnd 25 | - !MappingEnd 26 | - !Scalar { implicit: [true,true], value: 'flow mapping' } 27 | - !MappingStart { flow_style: true } 28 | - !Scalar { implicit: [true,true], value: 'key' } 29 | - !Scalar { implicit: [true,true], value: 'value' } 30 | - !MappingStart 31 | - !Scalar { implicit: [true,true], value: 'complex' } 32 | - !Scalar { implicit: [true,true], value: 'key' } 33 | - !Scalar { implicit: [true,true], value: 'complex' } 34 | - !Scalar { implicit: [true,true], value: 'key' } 35 | - !MappingEnd 36 | - !MappingStart 37 | - !Scalar { implicit: [true,true], value: 'complex' } 38 | - !Scalar { implicit: [true,true], value: 'key' } 39 | - !MappingEnd 40 | - !MappingEnd 41 | - !MappingEnd 42 | - !DocumentEnd 43 | 44 | - !StreamEnd 45 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/merge.data: -------------------------------------------------------------------------------- 1 | - << 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/merge.detect: -------------------------------------------------------------------------------- 1 | tag:yaml.org,2002:merge 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/more-floats.code: -------------------------------------------------------------------------------- 1 | [0.0, +1.0, -1.0, +1e300000, -1e300000, 1e300000/1e300000, -(1e300000/1e300000)] # last two items are ind and qnan respectively. 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/more-floats.data: -------------------------------------------------------------------------------- 1 | [0.0, +1.0, -1.0, +.inf, -.inf, .nan, .nan] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/multi-constructor.code: -------------------------------------------------------------------------------- 1 | [ 2 | {'Tag1': ['a', 1, 'b', 2]}, 3 | {'Tag2': ['a', 1, 'b', 2]}, 4 | ] 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/multi-constructor.multi: -------------------------------------------------------------------------------- 1 | --- 2 | - !Tag1 [a, 1, b, 2] 3 | - !!Tag2 [a, 1, b, 2] 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/myfullloader.subclass_blacklist: -------------------------------------------------------------------------------- 1 | - !!python/object/new:yaml.MappingNode 2 | args: 3 | state: 4 | mymethod: test 5 | wrong_method: test2 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/negative-float-bug.code: -------------------------------------------------------------------------------- 1 | -1.0 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/negative-float-bug.data: -------------------------------------------------------------------------------- 1 | -1.0 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/no-alias-anchor.emitter-error: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | - !DocumentStart 3 | - !SequenceStart 4 | - !Scalar { anchor: A, value: data } 5 | - !Alias { } 6 | - !SequenceEnd 7 | - !DocumentEnd 8 | - !StreamEnd 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/no-alias-anchor.skip-ext: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaml/pyyaml/69c141adcf805c5ebdc9ba519927642ee5c7f639/tests/legacy_tests/data/no-alias-anchor.skip-ext -------------------------------------------------------------------------------- /tests/legacy_tests/data/no-block-collection-end.loader-error: -------------------------------------------------------------------------------- 1 | - foo 2 | - bar 3 | baz: bar 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/no-block-mapping-end-2.loader-error: -------------------------------------------------------------------------------- 1 | ? foo 2 | : bar 3 | : baz 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/no-block-mapping-end.loader-error: -------------------------------------------------------------------------------- 1 | foo: "bar" "baz" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/no-document-start.loader-error: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | # no --- 3 | foo: bar 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/no-flow-mapping-end.loader-error: -------------------------------------------------------------------------------- 1 | { foo: bar ] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/no-flow-sequence-end.loader-error: -------------------------------------------------------------------------------- 1 | [foo, bar} 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/no-node-1.loader-error: -------------------------------------------------------------------------------- 1 | - !foo ] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/no-node-2.loader-error: -------------------------------------------------------------------------------- 1 | - [ !foo } ] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/no-tag.emitter-error: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | - !DocumentStart 3 | - !Scalar { value: 'foo', implicit: [false,false] } 4 | - !DocumentEnd 5 | - !StreamEnd 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/null.data: -------------------------------------------------------------------------------- 1 | - 2 | - ~ 3 | - null 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/null.detect: -------------------------------------------------------------------------------- 1 | tag:yaml.org,2002:null 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/odd-utf16.stream-error: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaml/pyyaml/69c141adcf805c5ebdc9ba519927642ee5c7f639/tests/legacy_tests/data/odd-utf16.stream-error -------------------------------------------------------------------------------- /tests/legacy_tests/data/overwrite-state-new-constructor.loader-error: -------------------------------------------------------------------------------- 1 | - !!python/object/new:yaml.MappingNode 2 | args: 3 | state: 4 | extend: test 5 | __test__: test 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/recursive-anchor.former-loader-error: -------------------------------------------------------------------------------- 1 | - &foo [1 2 | 2, 3 | 3, 4 | *foo] 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/recursive-dict.recursive: -------------------------------------------------------------------------------- 1 | value = {} 2 | instance = AnInstance(value, value) 3 | value[instance] = instance 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/recursive-list.recursive: -------------------------------------------------------------------------------- 1 | value = [] 2 | value.append(value) 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/recursive-set.recursive: -------------------------------------------------------------------------------- 1 | try: 2 | set 3 | except NameError: 4 | from sets import Set as set 5 | value = set() 6 | value.add(AnInstance(foo=value, bar=value)) 7 | value.add(AnInstance(foo=value, bar=value)) 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/recursive-state.recursive: -------------------------------------------------------------------------------- 1 | value = [] 2 | value.append(AnInstanceWithState(value, value)) 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/recursive-tuple.recursive: -------------------------------------------------------------------------------- 1 | value = ([], []) 2 | value[0].append(value) 3 | value[1].append(value[0]) 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/recursive.former-dumper-error: -------------------------------------------------------------------------------- 1 | data = [] 2 | data.append(data) 3 | dump(data) 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/remove-possible-simple-key-bug.loader-error: -------------------------------------------------------------------------------- 1 | foo: &A bar 2 | *A ] # The ']' indicator triggers remove_possible_simple_key, 3 | # which should raise an error. 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/resolver.data: -------------------------------------------------------------------------------- 1 | --- 2 | "this scalar should be selected" 3 | --- 4 | key11: !foo 5 | key12: 6 | is: [selected] 7 | key22: 8 | key13: [not, selected] 9 | key23: [not, selected] 10 | key32: 11 | key31: [not, selected] 12 | key32: [not, selected] 13 | key33: {not: selected} 14 | key21: !bar 15 | - not selected 16 | - selected 17 | - not selected 18 | key31: !baz 19 | key12: 20 | key13: 21 | key14: {selected} 22 | key23: 23 | key14: [not, selected] 24 | key33: 25 | key14: {selected} 26 | key24: {not: selected} 27 | key22: 28 | - key14: {selected} 29 | key24: {not: selected} 30 | - key14: {selected} 31 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/resolver.path: -------------------------------------------------------------------------------- 1 | --- !root/scalar 2 | "this scalar should be selected" 3 | --- !root 4 | key11: !foo 5 | key12: !root/key11/key12/* 6 | is: [selected] 7 | key22: 8 | key13: [not, selected] 9 | key23: [not, selected] 10 | key32: 11 | key31: [not, selected] 12 | key32: [not, selected] 13 | key33: {not: selected} 14 | key21: !bar 15 | - not selected 16 | - !root/key21/1/* selected 17 | - not selected 18 | key31: !baz 19 | key12: 20 | key13: 21 | key14: !root/key31/*/*/key14/map {selected} 22 | key23: 23 | key14: [not, selected] 24 | key33: 25 | key14: !root/key31/*/*/key14/map {selected} 26 | key24: {not: selected} 27 | key22: 28 | - key14: !root/key31/*/*/key14/map {selected} 29 | key24: {not: selected} 30 | - key14: !root/key31/*/*/key14/map {selected} 31 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/run-parser-crash-bug.data: -------------------------------------------------------------------------------- 1 | --- 2 | - Harry Potter and the Prisoner of Azkaban 3 | - Harry Potter and the Goblet of Fire 4 | - Harry Potter and the Order of the Phoenix 5 | --- 6 | - Memoirs Found in a Bathtub 7 | - Snow Crash 8 | - Ghost World 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/scalars.events: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | 3 | - !DocumentStart 4 | - !MappingStart 5 | - !Scalar { implicit: [true,true], value: 'empty scalar' } 6 | - !Scalar { implicit: [true,false], value: '' } 7 | - !Scalar { implicit: [true,true], value: 'implicit scalar' } 8 | - !Scalar { implicit: [true,true], value: 'data' } 9 | - !Scalar { implicit: [true,true], value: 'quoted scalar' } 10 | - !Scalar { value: 'data', style: '"' } 11 | - !Scalar { implicit: [true,true], value: 'block scalar' } 12 | - !Scalar { value: 'data', style: '|' } 13 | - !Scalar { implicit: [true,true], value: 'empty scalar with tag' } 14 | - !Scalar { implicit: [false,false], tag: '!mytag', value: '' } 15 | - !Scalar { implicit: [true,true], value: 'implicit scalar with tag' } 16 | - !Scalar { implicit: [false,false], tag: '!mytag', value: 'data' } 17 | - !Scalar { implicit: [true,true], value: 'quoted scalar with tag' } 18 | - !Scalar { value: 'data', style: '"', tag: '!mytag', implicit: [false,false] } 19 | - !Scalar { implicit: [true,true], value: 'block scalar with tag' } 20 | - !Scalar { value: 'data', style: '|', tag: '!mytag', implicit: [false,false] } 21 | - !Scalar { implicit: [true,true], value: 'single character' } 22 | - !Scalar { value: 'a', implicit: [true,true] } 23 | - !Scalar { implicit: [true,true], value: 'single digit' } 24 | - !Scalar { value: '1', implicit: [true,false] } 25 | - !MappingEnd 26 | - !DocumentEnd 27 | 28 | - !StreamEnd 29 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/scan-document-end-bug.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!null "" 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/scan-document-end-bug.data: -------------------------------------------------------------------------------- 1 | # Ticket #4 2 | --- 3 | ... -------------------------------------------------------------------------------- /tests/legacy_tests/data/scan-line-break-bug.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { ? !!str "foo" : !!str "bar baz" } 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/scan-line-break-bug.data: -------------------------------------------------------------------------------- 1 | foo: 2 | bar 3 | baz 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/sequences.events: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | 3 | - !DocumentStart 4 | - !SequenceStart 5 | - !SequenceEnd 6 | - !DocumentEnd 7 | 8 | - !DocumentStart 9 | - !SequenceStart { tag: '!mytag', implicit: false } 10 | - !SequenceEnd 11 | - !DocumentEnd 12 | 13 | - !DocumentStart 14 | - !SequenceStart 15 | - !SequenceStart 16 | - !SequenceEnd 17 | - !SequenceStart { tag: '!mytag', implicit: false } 18 | - !SequenceEnd 19 | - !SequenceStart 20 | - !Scalar 21 | - !Scalar { value: 'data' } 22 | - !Scalar { tag: '!mytag', implicit: [false,false], value: 'data' } 23 | - !SequenceEnd 24 | - !SequenceStart 25 | - !SequenceStart 26 | - !SequenceStart 27 | - !Scalar 28 | - !SequenceEnd 29 | - !SequenceEnd 30 | - !SequenceEnd 31 | - !SequenceStart 32 | - !SequenceStart { tag: '!mytag', implicit: false } 33 | - !SequenceStart 34 | - !Scalar { value: 'data' } 35 | - !SequenceEnd 36 | - !SequenceEnd 37 | - !SequenceEnd 38 | - !SequenceEnd 39 | - !DocumentEnd 40 | 41 | - !DocumentStart 42 | - !SequenceStart 43 | - !MappingStart 44 | - !Scalar { value: 'key1' } 45 | - !SequenceStart 46 | - !Scalar { value: 'data1' } 47 | - !Scalar { value: 'data2' } 48 | - !SequenceEnd 49 | - !Scalar { value: 'key2' } 50 | - !SequenceStart { tag: '!mytag1', implicit: false } 51 | - !Scalar { value: 'data3' } 52 | - !SequenceStart 53 | - !Scalar { value: 'data4' } 54 | - !Scalar { value: 'data5' } 55 | - !SequenceEnd 56 | - !SequenceStart { tag: '!mytag2', implicit: false } 57 | - !Scalar { value: 'data6' } 58 | - !Scalar { value: 'data7' } 59 | - !SequenceEnd 60 | - !SequenceEnd 61 | - !MappingEnd 62 | - !SequenceEnd 63 | - !DocumentEnd 64 | 65 | - !DocumentStart 66 | - !SequenceStart 67 | - !SequenceStart { flow_style: true } 68 | - !SequenceStart 69 | - !SequenceEnd 70 | - !Scalar 71 | - !Scalar { value: 'data' } 72 | - !Scalar { tag: '!mytag', implicit: [false,false], value: 'data' } 73 | - !SequenceStart { tag: '!mytag', implicit: false } 74 | - !Scalar { value: 'data' } 75 | - !Scalar { value: 'data' } 76 | - !SequenceEnd 77 | - !SequenceEnd 78 | - !SequenceEnd 79 | - !DocumentEnd 80 | 81 | - !StreamEnd 82 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/serializer-is-already-opened.dumper-error: -------------------------------------------------------------------------------- 1 | dumper = yaml.Dumper(StringIO()) 2 | dumper.open() 3 | dumper.open() 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/serializer-is-closed-1.dumper-error: -------------------------------------------------------------------------------- 1 | dumper = yaml.Dumper(StringIO()) 2 | dumper.open() 3 | dumper.close() 4 | dumper.open() 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/serializer-is-closed-2.dumper-error: -------------------------------------------------------------------------------- 1 | dumper = yaml.Dumper(StringIO()) 2 | dumper.open() 3 | dumper.close() 4 | dumper.serialize(yaml.ScalarNode(tag='!foo', value='bar')) 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/serializer-is-not-opened-1.dumper-error: -------------------------------------------------------------------------------- 1 | dumper = yaml.Dumper(StringIO()) 2 | dumper.close() 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/serializer-is-not-opened-2.dumper-error: -------------------------------------------------------------------------------- 1 | dumper = yaml.Dumper(StringIO()) 2 | dumper.serialize(yaml.ScalarNode(tag='!foo', value='bar')) 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/single-dot-is-not-float-bug.code: -------------------------------------------------------------------------------- 1 | '.' 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/single-dot-is-not-float-bug.data: -------------------------------------------------------------------------------- 1 | . 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/sloppy-indentation.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "in the block context" 5 | : !!map { 6 | ? !!str "indentation should be kept" 7 | : !!map { 8 | ? !!str "but in the flow context" 9 | : !!seq [ !!str "it may be violated" ] 10 | } 11 | } 12 | } 13 | --- !!str 14 | "the parser does not require scalars to be indented with at least one space" 15 | --- !!str 16 | "the parser does not require scalars to be indented with at least one space" 17 | --- !!map 18 | { ? !!str "foo": { ? !!str "bar" : !!str "quoted scalars may not adhere indentation" } } 19 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/sloppy-indentation.data: -------------------------------------------------------------------------------- 1 | --- 2 | in the block context: 3 | indentation should be kept: { 4 | but in the flow context: [ 5 | it may be violated] 6 | } 7 | --- 8 | the parser does not require scalars 9 | to be indented with at least one space 10 | ... 11 | --- 12 | "the parser does not require scalars 13 | to be indented with at least one space" 14 | --- 15 | foo: 16 | bar: 'quoted scalars 17 | may not adhere indentation' 18 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-01.data: -------------------------------------------------------------------------------- 1 | - Mark McGwire 2 | - Sammy Sosa 3 | - Ken Griffey 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-01.structure: -------------------------------------------------------------------------------- 1 | [True, True, True] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-01.tokens: -------------------------------------------------------------------------------- 1 | [[ , _ , _ , _ ]} 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-02.data: -------------------------------------------------------------------------------- 1 | hr: 65 # Home runs 2 | avg: 0.278 # Batting average 3 | rbi: 147 # Runs Batted In 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-02.structure: -------------------------------------------------------------------------------- 1 | [(True, True), (True, True), (True, True)] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-02.tokens: -------------------------------------------------------------------------------- 1 | {{ 2 | ? _ : _ 3 | ? _ : _ 4 | ? _ : _ 5 | ]} 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-03.data: -------------------------------------------------------------------------------- 1 | american: 2 | - Boston Red Sox 3 | - Detroit Tigers 4 | - New York Yankees 5 | national: 6 | - New York Mets 7 | - Chicago Cubs 8 | - Atlanta Braves 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-03.structure: -------------------------------------------------------------------------------- 1 | [(True, [True, True, True]), (True, [True, True, True])] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-03.tokens: -------------------------------------------------------------------------------- 1 | {{ 2 | ? _ : [[ , _ , _ , _ ]} 3 | ? _ : [[ , _ , _ , _ ]} 4 | ]} 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-04.data: -------------------------------------------------------------------------------- 1 | - 2 | name: Mark McGwire 3 | hr: 65 4 | avg: 0.278 5 | - 6 | name: Sammy Sosa 7 | hr: 63 8 | avg: 0.288 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-04.structure: -------------------------------------------------------------------------------- 1 | [ 2 | [(True, True), (True, True), (True, True)], 3 | [(True, True), (True, True), (True, True)], 4 | ] 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-04.tokens: -------------------------------------------------------------------------------- 1 | [[ 2 | , {{ ? _ : _ ? _ : _ ? _ : _ ]} 3 | , {{ ? _ : _ ? _ : _ ? _ : _ ]} 4 | ]} 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-05.data: -------------------------------------------------------------------------------- 1 | - [name , hr, avg ] 2 | - [Mark McGwire, 65, 0.278] 3 | - [Sammy Sosa , 63, 0.288] 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-05.structure: -------------------------------------------------------------------------------- 1 | [ 2 | [True, True, True], 3 | [True, True, True], 4 | [True, True, True], 5 | ] 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-05.tokens: -------------------------------------------------------------------------------- 1 | [[ 2 | , [ _ , _ , _ ] 3 | , [ _ , _ , _ ] 4 | , [ _ , _ , _ ] 5 | ]} 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-06.data: -------------------------------------------------------------------------------- 1 | Mark McGwire: {hr: 65, avg: 0.278} 2 | Sammy Sosa: { 3 | hr: 63, 4 | avg: 0.288 5 | } 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-06.structure: -------------------------------------------------------------------------------- 1 | [ 2 | (True, [(True, True), (True, True)]), 3 | (True, [(True, True), (True, True)]), 4 | ] 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-06.tokens: -------------------------------------------------------------------------------- 1 | {{ 2 | ? _ : { ? _ : _ , ? _ : _ } 3 | ? _ : { ? _ : _ , ? _ : _ } 4 | ]} 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-07.data: -------------------------------------------------------------------------------- 1 | # Ranking of 1998 home runs 2 | --- 3 | - Mark McGwire 4 | - Sammy Sosa 5 | - Ken Griffey 6 | 7 | # Team ranking 8 | --- 9 | - Chicago Cubs 10 | - St Louis Cardinals 11 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-07.structure: -------------------------------------------------------------------------------- 1 | [ 2 | [True, True, True], 3 | [True, True], 4 | ] 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-07.tokens: -------------------------------------------------------------------------------- 1 | --- 2 | [[ 3 | , _ 4 | , _ 5 | , _ 6 | ]} 7 | 8 | --- 9 | [[ 10 | , _ 11 | , _ 12 | ]} 13 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-08.data: -------------------------------------------------------------------------------- 1 | --- 2 | time: 20:03:20 3 | player: Sammy Sosa 4 | action: strike (miss) 5 | ... 6 | --- 7 | time: 20:03:47 8 | player: Sammy Sosa 9 | action: grand slam 10 | ... 11 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-08.structure: -------------------------------------------------------------------------------- 1 | [ 2 | [(True, True), (True, True), (True, True)], 3 | [(True, True), (True, True), (True, True)], 4 | ] 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-08.tokens: -------------------------------------------------------------------------------- 1 | --- 2 | {{ 3 | ? _ : _ 4 | ? _ : _ 5 | ? _ : _ 6 | ]} 7 | ... 8 | 9 | --- 10 | {{ 11 | ? _ : _ 12 | ? _ : _ 13 | ? _ : _ 14 | ]} 15 | ... 16 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-09.data: -------------------------------------------------------------------------------- 1 | --- 2 | hr: # 1998 hr ranking 3 | - Mark McGwire 4 | - Sammy Sosa 5 | rbi: 6 | # 1998 rbi ranking 7 | - Sammy Sosa 8 | - Ken Griffey 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-09.structure: -------------------------------------------------------------------------------- 1 | [(True, [True, True]), (True, [True, True])] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-09.tokens: -------------------------------------------------------------------------------- 1 | --- 2 | {{ 3 | ? _ : [[ , _ , _ ]} 4 | ? _ : [[ , _ , _ ]} 5 | ]} 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-10.data: -------------------------------------------------------------------------------- 1 | --- 2 | hr: 3 | - Mark McGwire 4 | # Following node labeled SS 5 | - &SS Sammy Sosa 6 | rbi: 7 | - *SS # Subsequent occurrence 8 | - Ken Griffey 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-10.structure: -------------------------------------------------------------------------------- 1 | [(True, [True, True]), (True, ['*', True])] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-10.tokens: -------------------------------------------------------------------------------- 1 | --- 2 | {{ 3 | ? _ : [[ , _ , & _ ]} 4 | ? _ : [[ , * , _ ]} 5 | ]} 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-11.data: -------------------------------------------------------------------------------- 1 | ? - Detroit Tigers 2 | - Chicago cubs 3 | : 4 | - 2001-07-23 5 | 6 | ? [ New York Yankees, 7 | Atlanta Braves ] 8 | : [ 2001-07-02, 2001-08-12, 9 | 2001-08-14 ] 10 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-11.structure: -------------------------------------------------------------------------------- 1 | [ 2 | ([True, True], [True]), 3 | ([True, True], [True, True, True]), 4 | ] 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-11.tokens: -------------------------------------------------------------------------------- 1 | {{ 2 | ? [[ , _ , _ ]} 3 | : [[ , _ ]} 4 | ? [ _ , _ ] 5 | : [ _ , _ , _ ] 6 | ]} 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-12.data: -------------------------------------------------------------------------------- 1 | --- 2 | # products purchased 3 | - item : Super Hoop 4 | quantity: 1 5 | - item : Basketball 6 | quantity: 4 7 | - item : Big Shoes 8 | quantity: 1 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-12.structure: -------------------------------------------------------------------------------- 1 | [ 2 | [(True, True), (True, True)], 3 | [(True, True), (True, True)], 4 | [(True, True), (True, True)], 5 | ] 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-12.tokens: -------------------------------------------------------------------------------- 1 | --- 2 | [[ 3 | , {{ ? _ : _ ? _ : _ ]} 4 | , {{ ? _ : _ ? _ : _ ]} 5 | , {{ ? _ : _ ? _ : _ ]} 6 | ]} 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-13.data: -------------------------------------------------------------------------------- 1 | # ASCII Art 2 | --- | 3 | \//||\/|| 4 | // || ||__ 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-13.structure: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-13.tokens: -------------------------------------------------------------------------------- 1 | --- _ 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-14.data: -------------------------------------------------------------------------------- 1 | --- 2 | Mark McGwire's 3 | year was crippled 4 | by a knee injury. 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-14.structure: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-14.tokens: -------------------------------------------------------------------------------- 1 | --- _ 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-15.data: -------------------------------------------------------------------------------- 1 | > 2 | Sammy Sosa completed another 3 | fine season with great stats. 4 | 5 | 63 Home Runs 6 | 0.288 Batting Average 7 | 8 | What a year! 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-15.structure: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-15.tokens: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-16.data: -------------------------------------------------------------------------------- 1 | name: Mark McGwire 2 | accomplishment: > 3 | Mark set a major league 4 | home run record in 1998. 5 | stats: | 6 | 65 Home Runs 7 | 0.278 Batting Average 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-16.structure: -------------------------------------------------------------------------------- 1 | [(True, True), (True, True), (True, True)] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-16.tokens: -------------------------------------------------------------------------------- 1 | {{ 2 | ? _ : _ 3 | ? _ : _ 4 | ? _ : _ 5 | ]} 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-17.data: -------------------------------------------------------------------------------- 1 | unicode: "Sosa did fine.\u263A" 2 | control: "\b1998\t1999\t2000\n" 3 | hexesc: "\x13\x10 is \r\n" 4 | 5 | single: '"Howdy!" he cried.' 6 | quoted: ' # not a ''comment''.' 7 | tie-fighter: '|\-*-/|' 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-17.structure: -------------------------------------------------------------------------------- 1 | [(True, True), (True, True), (True, True), (True, True), (True, True), (True, True)] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-17.tokens: -------------------------------------------------------------------------------- 1 | {{ 2 | ? _ : _ 3 | ? _ : _ 4 | ? _ : _ 5 | ? _ : _ 6 | ? _ : _ 7 | ? _ : _ 8 | ]} 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-18.data: -------------------------------------------------------------------------------- 1 | plain: 2 | This unquoted scalar 3 | spans many lines. 4 | 5 | quoted: "So does this 6 | quoted scalar.\n" 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-18.structure: -------------------------------------------------------------------------------- 1 | [(True, True), (True, True)] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-18.tokens: -------------------------------------------------------------------------------- 1 | {{ 2 | ? _ : _ 3 | ? _ : _ 4 | ]} 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-19.data: -------------------------------------------------------------------------------- 1 | canonical: 12345 2 | decimal: +12,345 3 | sexagesimal: 3:25:45 4 | octal: 014 5 | hexadecimal: 0xC 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-19.structure: -------------------------------------------------------------------------------- 1 | [(True, True), (True, True), (True, True), (True, True), (True, True)] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-19.tokens: -------------------------------------------------------------------------------- 1 | {{ 2 | ? _ : _ 3 | ? _ : _ 4 | ? _ : _ 5 | ? _ : _ 6 | ? _ : _ 7 | ]} 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-20.data: -------------------------------------------------------------------------------- 1 | canonical: 1.23015e+3 2 | exponential: 12.3015e+02 3 | sexagesimal: 20:30.15 4 | fixed: 1,230.15 5 | negative infinity: -.inf 6 | not a number: .NaN 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-20.structure: -------------------------------------------------------------------------------- 1 | [(True, True), (True, True), (True, True), (True, True), (True, True), (True, True)] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-20.tokens: -------------------------------------------------------------------------------- 1 | {{ 2 | ? _ : _ 3 | ? _ : _ 4 | ? _ : _ 5 | ? _ : _ 6 | ? _ : _ 7 | ? _ : _ 8 | ]} 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-21.data: -------------------------------------------------------------------------------- 1 | null: ~ 2 | true: y 3 | false: n 4 | string: '12345' 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-21.structure: -------------------------------------------------------------------------------- 1 | [(True, True), (True, True), (True, True), (True, True)] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-21.tokens: -------------------------------------------------------------------------------- 1 | {{ 2 | ? _ : _ 3 | ? _ : _ 4 | ? _ : _ 5 | ? _ : _ 6 | ]} 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-22.data: -------------------------------------------------------------------------------- 1 | canonical: 2001-12-15T02:59:43.1Z 2 | iso8601: 2001-12-14t21:59:43.10-05:00 3 | spaced: 2001-12-14 21:59:43.10 -5 4 | date: 2002-12-14 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-22.structure: -------------------------------------------------------------------------------- 1 | [(True, True), (True, True), (True, True), (True, True)] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-22.tokens: -------------------------------------------------------------------------------- 1 | {{ 2 | ? _ : _ 3 | ? _ : _ 4 | ? _ : _ 5 | ? _ : _ 6 | ]} 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-23.data: -------------------------------------------------------------------------------- 1 | --- 2 | not-date: !!str 2002-04-28 3 | 4 | picture: !!binary | 5 | R0lGODlhDAAMAIQAAP//9/X 6 | 17unp5WZmZgAAAOfn515eXv 7 | Pz7Y6OjuDg4J+fn5OTk6enp 8 | 56enmleECcgggoBADs= 9 | 10 | application specific tag: !something | 11 | The semantics of the tag 12 | above may be different for 13 | different documents. 14 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-23.structure: -------------------------------------------------------------------------------- 1 | [(True, True), (True, True), (True, True)] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-23.tokens: -------------------------------------------------------------------------------- 1 | --- 2 | {{ 3 | ? _ : ! _ 4 | ? _ : ! _ 5 | ? _ : ! _ 6 | ]} 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-24.data: -------------------------------------------------------------------------------- 1 | %TAG ! tag:clarkevans.com,2002: 2 | --- !shape 3 | # Use the ! handle for presenting 4 | # tag:clarkevans.com,2002:circle 5 | - !circle 6 | center: &ORIGIN {x: 73, y: 129} 7 | radius: 7 8 | - !line 9 | start: *ORIGIN 10 | finish: { x: 89, y: 102 } 11 | - !label 12 | start: *ORIGIN 13 | color: 0xFFEEBB 14 | text: Pretty vector drawing. 15 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-24.structure: -------------------------------------------------------------------------------- 1 | [ 2 | [(True, [(True, True), (True, True)]), (True, True)], 3 | [(True, '*'), (True, [(True, True), (True, True)])], 4 | [(True, '*'), (True, True), (True, True)], 5 | ] 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-24.tokens: -------------------------------------------------------------------------------- 1 | % 2 | --- ! 3 | [[ 4 | , ! 5 | {{ 6 | ? _ : & { ? _ : _ , ? _ : _ } 7 | ? _ : _ 8 | ]} 9 | , ! 10 | {{ 11 | ? _ : * 12 | ? _ : { ? _ : _ , ? _ : _ } 13 | ]} 14 | , ! 15 | {{ 16 | ? _ : * 17 | ? _ : _ 18 | ? _ : _ 19 | ]} 20 | ]} 21 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-25.data: -------------------------------------------------------------------------------- 1 | # sets are represented as a 2 | # mapping where each key is 3 | # associated with the empty string 4 | --- !!set 5 | ? Mark McGwire 6 | ? Sammy Sosa 7 | ? Ken Griff 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-25.structure: -------------------------------------------------------------------------------- 1 | [(True, None), (True, None), (True, None)] 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-25.tokens: -------------------------------------------------------------------------------- 1 | --- ! 2 | {{ 3 | ? _ 4 | ? _ 5 | ? _ 6 | ]} 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-26.data: -------------------------------------------------------------------------------- 1 | # ordered maps are represented as 2 | # a sequence of mappings, with 3 | # each mapping having one key 4 | --- !!omap 5 | - Mark McGwire: 65 6 | - Sammy Sosa: 63 7 | - Ken Griffy: 58 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-26.structure: -------------------------------------------------------------------------------- 1 | [ 2 | [(True, True)], 3 | [(True, True)], 4 | [(True, True)], 5 | ] 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-26.tokens: -------------------------------------------------------------------------------- 1 | --- ! 2 | [[ 3 | , {{ ? _ : _ ]} 4 | , {{ ? _ : _ ]} 5 | , {{ ? _ : _ ]} 6 | ]} 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-27.data: -------------------------------------------------------------------------------- 1 | --- ! 2 | invoice: 34843 3 | date : 2001-01-23 4 | bill-to: &id001 5 | given : Chris 6 | family : Dumars 7 | address: 8 | lines: | 9 | 458 Walkman Dr. 10 | Suite #292 11 | city : Royal Oak 12 | state : MI 13 | postal : 48046 14 | ship-to: *id001 15 | product: 16 | - sku : BL394D 17 | quantity : 4 18 | description : Basketball 19 | price : 450.00 20 | - sku : BL4438H 21 | quantity : 1 22 | description : Super Hoop 23 | price : 2392.00 24 | tax : 251.42 25 | total: 4443.52 26 | comments: 27 | Late afternoon is best. 28 | Backup contact is Nancy 29 | Billsmer @ 338-4338. 30 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-27.structure: -------------------------------------------------------------------------------- 1 | [ 2 | (True, True), 3 | (True, True), 4 | (True, [ 5 | (True, True), 6 | (True, True), 7 | (True, [(True, True), (True, True), (True, True), (True, True)]), 8 | ]), 9 | (True, '*'), 10 | (True, [ 11 | [(True, True), (True, True), (True, True), (True, True)], 12 | [(True, True), (True, True), (True, True), (True, True)], 13 | ]), 14 | (True, True), 15 | (True, True), 16 | (True, True), 17 | ] 18 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-27.tokens: -------------------------------------------------------------------------------- 1 | --- ! 2 | {{ 3 | ? _ : _ 4 | ? _ : _ 5 | ? _ : & 6 | {{ 7 | ? _ : _ 8 | ? _ : _ 9 | ? _ : {{ ? _ : _ ? _ : _ ? _ : _ ? _ : _ ]} 10 | ]} 11 | ? _ : * 12 | ? _ : 13 | [[ 14 | , {{ ? _ : _ ? _ : _ ? _ : _ ? _ : _ ]} 15 | , {{ ? _ : _ ? _ : _ ? _ : _ ? _ : _ ]} 16 | ]} 17 | ? _ : _ 18 | ? _ : _ 19 | ? _ : _ 20 | ]} 21 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-28.data: -------------------------------------------------------------------------------- 1 | --- 2 | Time: 2001-11-23 15:01:42 -5 3 | User: ed 4 | Warning: 5 | This is an error message 6 | for the log file 7 | --- 8 | Time: 2001-11-23 15:02:31 -5 9 | User: ed 10 | Warning: 11 | A slightly different error 12 | message. 13 | --- 14 | Date: 2001-11-23 15:03:17 -5 15 | User: ed 16 | Fatal: 17 | Unknown variable "bar" 18 | Stack: 19 | - file: TopClass.py 20 | line: 23 21 | code: | 22 | x = MoreObject("345\n") 23 | - file: MoreClass.py 24 | line: 58 25 | code: |- 26 | foo = bar 27 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-28.structure: -------------------------------------------------------------------------------- 1 | [ 2 | [(True, True), (True, True), (True, True)], 3 | [(True, True), (True, True), (True, True)], 4 | [(True, True), (True, True), (True, True), 5 | (True, [ 6 | [(True, True), (True, True), (True, True)], 7 | [(True, True), (True, True), (True, True)], 8 | ]), 9 | ] 10 | ] 11 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-02-28.tokens: -------------------------------------------------------------------------------- 1 | --- 2 | {{ 3 | ? _ : _ 4 | ? _ : _ 5 | ? _ : _ 6 | ]} 7 | --- 8 | {{ 9 | ? _ : _ 10 | ? _ : _ 11 | ? _ : _ 12 | ]} 13 | --- 14 | {{ 15 | ? _ : _ 16 | ? _ : _ 17 | ? _ : _ 18 | ? _ : 19 | [[ 20 | , {{ ? _ : _ ? _ : _ ? _ : _ ]} 21 | , {{ ? _ : _ ? _ : _ ? _ : _ ]} 22 | ]} 23 | ]} 24 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-01-utf16be.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaml/pyyaml/69c141adcf805c5ebdc9ba519927642ee5c7f639/tests/legacy_tests/data/spec-05-01-utf16be.data -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-01-utf16be.empty: -------------------------------------------------------------------------------- 1 | # This stream contains no 2 | # documents, only comments. 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-01-utf16le.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaml/pyyaml/69c141adcf805c5ebdc9ba519927642ee5c7f639/tests/legacy_tests/data/spec-05-01-utf16le.data -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-01-utf16le.empty: -------------------------------------------------------------------------------- 1 | # This stream contains no 2 | # documents, only comments. 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-01-utf8.data: -------------------------------------------------------------------------------- 1 | # Comment only. 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-01-utf8.empty: -------------------------------------------------------------------------------- 1 | # This stream contains no 2 | # documents, only comments. 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-02-utf16be.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaml/pyyaml/69c141adcf805c5ebdc9ba519927642ee5c7f639/tests/legacy_tests/data/spec-05-02-utf16be.data -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-02-utf16be.error: -------------------------------------------------------------------------------- 1 | ERROR: 2 | A BOM must not appear 3 | inside a document. 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-02-utf16le.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaml/pyyaml/69c141adcf805c5ebdc9ba519927642ee5c7f639/tests/legacy_tests/data/spec-05-02-utf16le.data -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-02-utf16le.error: -------------------------------------------------------------------------------- 1 | ERROR: 2 | A BOM must not appear 3 | inside a document. 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-02-utf8.data: -------------------------------------------------------------------------------- 1 | # Invalid use of BOM 2 | # inside a 3 | # document. 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-02-utf8.error: -------------------------------------------------------------------------------- 1 | ERROR: 2 | A BOM must not appear 3 | inside a document. 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-03.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "sequence" 5 | : !!seq [ 6 | !!str "one", !!str "two" 7 | ], 8 | ? !!str "mapping" 9 | : !!map { 10 | ? !!str "sky" : !!str "blue", 11 | # ? !!str "sea" : !!str "green", 12 | ? !!map { ? !!str "sea" : !!str "green" } : !!null "", 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-03.data: -------------------------------------------------------------------------------- 1 | sequence: 2 | - one 3 | - two 4 | mapping: 5 | ? sky 6 | : blue 7 | ? sea : green 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-04.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "sequence" 5 | : !!seq [ 6 | !!str "one", !!str "two" 7 | ], 8 | ? !!str "mapping" 9 | : !!map { 10 | ? !!str "sky" : !!str "blue", 11 | ? !!str "sea" : !!str "green", 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-04.data: -------------------------------------------------------------------------------- 1 | sequence: [ one, two, ] 2 | mapping: { sky: blue, sea: green } 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-05.data: -------------------------------------------------------------------------------- 1 | # Comment only. 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-05.empty: -------------------------------------------------------------------------------- 1 | # This stream contains no 2 | # documents, only comments. 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-06.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "anchored" 5 | : &A1 !local "value", 6 | ? !!str "alias" 7 | : *A1, 8 | } 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-06.data: -------------------------------------------------------------------------------- 1 | anchored: !local &anchor value 2 | alias: *anchor 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-07.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "literal" 5 | : !!str "text\n", 6 | ? !!str "folded" 7 | : !!str "text\n", 8 | } 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-07.data: -------------------------------------------------------------------------------- 1 | literal: | 2 | text 3 | folded: > 4 | text 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-08.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "single" 5 | : !!str "text", 6 | ? !!str "double" 7 | : !!str "text", 8 | } 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-08.data: -------------------------------------------------------------------------------- 1 | single: 'text' 2 | double: "text" 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-09.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "text" 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-09.data: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- text 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-10.data: -------------------------------------------------------------------------------- 1 | commercial-at: @text 2 | grave-accent: `text 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-10.error: -------------------------------------------------------------------------------- 1 | ERROR: 2 | Reserved indicators can't 3 | start a plain scalar. 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-11.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- !!str 3 | "Generic line break (no glyph)\n\ 4 | Generic line break (glyphed)\n\ 5 | Line separator\u2028\ 6 | Paragraph separator\u2029" 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-11.data: -------------------------------------------------------------------------------- 1 | | 2 | Generic line break (no glyph) 3 | Generic line break (glyphed)… Line separator
 Paragraph separator
 -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-12.data: -------------------------------------------------------------------------------- 1 | # Tabs do's and don'ts: 2 | # comment: 3 | quoted: "Quoted " 4 | block: | 5 | void main() { 6 | printf("Hello, world!\n"); 7 | } 8 | elsewhere: # separation 9 | indentation, in plain scalar 10 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-12.error: -------------------------------------------------------------------------------- 1 | ERROR: 2 | Tabs may appear inside 3 | comments and quoted or 4 | block scalar content. 5 | Tabs must not appear 6 | elsewhere, such as 7 | in indentation and 8 | separation spaces. 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-13.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- !!str 3 | "Text containing \ 4 | both space and \ 5 | tab characters" 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-13.data: -------------------------------------------------------------------------------- 1 | "Text containing 2 | both space and 3 | tab characters" 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-14.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | "Fun with \x5C 4 | \x22 \x07 \x08 \x1B \x0C 5 | \x0A \x0D \x09 \x0B \x00 6 | \x20 \xA0 \x85 \u2028 \u2029 7 | A A A" 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-14.data: -------------------------------------------------------------------------------- 1 | "Fun with \\ 2 | \" \a \b \e \f \… \n \r \t \v \0 \
 \ \_ \N \L \P \
 \x41 \u0041 \U00000041" 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-15.data: -------------------------------------------------------------------------------- 1 | Bad escapes: 2 | "\c 3 | \xq-" 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-05-15.error: -------------------------------------------------------------------------------- 1 | ERROR: 2 | - c is an invalid escaped character. 3 | - q and - are invalid hex digits. 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-06-01.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "Not indented" 5 | : !!map { 6 | ? !!str "By one space" 7 | : !!str "By four\n spaces\n", 8 | ? !!str "Flow style" 9 | : !!seq [ 10 | !!str "By two", 11 | !!str "Also by two", 12 | !!str "Still by two", 13 | ] 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-06-01.data: -------------------------------------------------------------------------------- 1 | # Leading comment line spaces are 2 | # neither content nor indentation. 3 | 4 | Not indented: 5 | By one space: | 6 | By four 7 | spaces 8 | Flow style: [ # Leading spaces 9 | By two, # in flow style 10 | Also by two, # are neither 11 | # Tabs are not allowed: 12 | # Still by two # content nor 13 | Still by two # content nor 14 | ] # indentation. 15 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-06-02.data: -------------------------------------------------------------------------------- 1 | # Comment 2 | 3 | 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-06-02.empty: -------------------------------------------------------------------------------- 1 | # This stream contains no 2 | # documents, only comments. 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-06-03.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "key" 5 | : !!str "value" 6 | } 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-06-03.data: -------------------------------------------------------------------------------- 1 | key: # Comment 2 | value 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-06-04.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "key" 5 | : !!str "value" 6 | } 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-06-04.data: -------------------------------------------------------------------------------- 1 | key: # Comment 2 | # lines 3 | value 4 | 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-06-05.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!map { 5 | ? !!str "first" 6 | : !!str "Sammy", 7 | ? !!str "last" 8 | : !!str "Sosa" 9 | } 10 | : !!map { 11 | ? !!str "hr" 12 | : !!int "65", 13 | ? !!str "avg" 14 | : !!float "0.278" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-06-05.data: -------------------------------------------------------------------------------- 1 | { first: Sammy, last: Sosa }: 2 | # Statistics: 3 | hr: # Home runs 4 | 65 5 | avg: # Average 6 | 0.278 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-06-06.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "plain" 5 | : !!str "text lines", 6 | ? !!str "quoted" 7 | : !!str "text lines", 8 | ? !!str "block" 9 | : !!str "text\n lines\n" 10 | } 11 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-06-06.data: -------------------------------------------------------------------------------- 1 | plain: text 2 | lines 3 | quoted: "text 4 | lines" 5 | block: | 6 | text 7 | lines 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-06-07.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | !!str "foo\nbar", 5 | !!str "foo\n\nbar" 6 | ] 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-06-07.data: -------------------------------------------------------------------------------- 1 | - foo 2 | 3 | bar 4 | - |- 5 | foo 6 | 7 | bar 8 | 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-06-08.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- !!str 3 | "specific\L\ 4 | trimmed\n\n\n\ 5 | as space" 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-06-08.data: -------------------------------------------------------------------------------- 1 | >- 2 | specific
 trimmed… … …… as… space 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-01.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- !!str 3 | "foo" 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-01.data: -------------------------------------------------------------------------------- 1 | %FOO bar baz # Should be ignored 2 | # with a warning. 3 | --- "foo" 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-01.skip-ext: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaml/pyyaml/69c141adcf805c5ebdc9ba519927642ee5c7f639/tests/legacy_tests/data/spec-07-01.skip-ext -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-02.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "foo" 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-02.data: -------------------------------------------------------------------------------- 1 | %YAML 1.2 # Attempt parsing 2 | # with a warning 3 | --- 4 | "foo" 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-02.skip-ext: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaml/pyyaml/69c141adcf805c5ebdc9ba519927642ee5c7f639/tests/legacy_tests/data/spec-07-02.skip-ext -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-03.data: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %YAML 1.1 3 | foo 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-03.error: -------------------------------------------------------------------------------- 1 | ERROR: 2 | The YAML directive must only be 3 | given at most once per document. 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-04.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "foo" 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-04.data: -------------------------------------------------------------------------------- 1 | %TAG !yaml! tag:yaml.org,2002: 2 | --- 3 | !yaml!str "foo" 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-05.data: -------------------------------------------------------------------------------- 1 | %TAG ! !foo 2 | %TAG ! !foo 3 | bar 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-05.error: -------------------------------------------------------------------------------- 1 | ERROR: 2 | The TAG directive must only 3 | be given at most once per 4 | handle in the same document. 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-06.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | ! "baz", 5 | ! "string" 6 | ] 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-06.data: -------------------------------------------------------------------------------- 1 | %TAG ! !foo 2 | %TAG !yaml! tag:yaml.org,2002: 3 | --- 4 | - !bar "baz" 5 | - !yaml!str "string" 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-07a.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | ! "bar" 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-07a.data: -------------------------------------------------------------------------------- 1 | # Private application: 2 | !foo "bar" 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-07b.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | ! "bar" 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-07b.data: -------------------------------------------------------------------------------- 1 | # Migrated to global: 2 | %TAG ! tag:ben-kiki.org,2000:app/ 3 | --- 4 | !foo "bar" 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-08.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | ! "bar", 5 | ! "string", 6 | ! "baz" 7 | ] 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-08.data: -------------------------------------------------------------------------------- 1 | # Explicitly specify default settings: 2 | %TAG ! ! 3 | %TAG !! tag:yaml.org,2002: 4 | # Named handles have no default: 5 | %TAG !o! tag:ben-kiki.org,2000: 6 | --- 7 | - !foo "bar" 8 | - !!str "string" 9 | - !o!type "baz" 10 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-09.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "foo" 4 | %YAML 1.1 5 | --- 6 | !!str "bar" 7 | %YAML 1.1 8 | --- 9 | !!str "baz" 10 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-09.data: -------------------------------------------------------------------------------- 1 | --- 2 | foo 3 | ... 4 | # Repeated end marker. 5 | ... 6 | --- 7 | bar 8 | # No end marker. 9 | --- 10 | baz 11 | ... 12 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-10.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "Root flow scalar" 4 | %YAML 1.1 5 | --- 6 | !!str "Root block scalar\n" 7 | %YAML 1.1 8 | --- 9 | !!map { 10 | ? !!str "foo" 11 | : !!str "bar" 12 | } 13 | --- 14 | #!!str "" 15 | !!null "" 16 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-10.data: -------------------------------------------------------------------------------- 1 | "Root flow 2 | scalar" 3 | --- !!str > 4 | Root block 5 | scalar 6 | --- 7 | # Root collection: 8 | foo : bar 9 | ... # Is optional. 10 | --- 11 | # Explicit document may be empty. 12 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-11.data: -------------------------------------------------------------------------------- 1 | # A stream may contain 2 | # no documents. 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-11.empty: -------------------------------------------------------------------------------- 1 | # This stream contains no 2 | # documents, only comments. 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-12a.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "foo" 5 | : !!str "bar" 6 | } 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-12a.data: -------------------------------------------------------------------------------- 1 | # Implicit document. Root 2 | # collection (mapping) node. 3 | foo : bar 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-12b.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "Text content\n" 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-12b.data: -------------------------------------------------------------------------------- 1 | # Explicit document. Root 2 | # scalar (literal) node. 3 | --- | 4 | Text content 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-13.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "First document" 4 | --- 5 | ! "No directives" 6 | --- 7 | ! "With directives" 8 | --- 9 | ! "Reset settings" 10 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-07-13.data: -------------------------------------------------------------------------------- 1 | ! "First document" 2 | --- 3 | !foo "No directives" 4 | %TAG ! !foo 5 | --- 6 | !bar "With directives" 7 | %YAML 1.1 8 | --- 9 | !baz "Reset settings" 10 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-01.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? &A1 !!str "foo" 5 | : !!str "bar", 6 | ? &A2 !!str "baz" 7 | : *A1 8 | } 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-01.data: -------------------------------------------------------------------------------- 1 | !!str &a1 "foo" : !!str bar 2 | &a2 baz : *a1 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-02.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "First occurrence" 5 | : &A !!str "Value", 6 | ? !!str "Second occurrence" 7 | : *A 8 | } 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-02.data: -------------------------------------------------------------------------------- 1 | First occurrence: &anchor Value 2 | Second occurrence: *anchor 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-03.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? ! "foo" 5 | : ! "baz" 6 | } 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-03.data: -------------------------------------------------------------------------------- 1 | ! foo : 2 | ! baz 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-04.data: -------------------------------------------------------------------------------- 1 | - ! foo 2 | - !<$:?> bar 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-04.error: -------------------------------------------------------------------------------- 1 | ERROR: 2 | - Verbatim tags aren't resolved, 3 | so ! is invalid. 4 | - The $:? tag is neither a global 5 | URI tag nor a local tag starting 6 | with “!”. 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-05.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | ! "foo", 5 | ! "bar", 6 | ! "baz", 7 | ] 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-05.data: -------------------------------------------------------------------------------- 1 | %TAG !o! tag:ben-kiki.org,2000: 2 | --- 3 | - !local foo 4 | - !!str bar 5 | - !o!type baz 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-06.data: -------------------------------------------------------------------------------- 1 | %TAG !o! tag:ben-kiki.org,2000: 2 | --- 3 | - !$a!b foo 4 | - !o! bar 5 | - !h!type baz 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-06.error: -------------------------------------------------------------------------------- 1 | ERROR: 2 | - The !$a! looks like a handle. 3 | - The !o! handle has no suffix. 4 | - The !h! handle wasn't declared. 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-07.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | ! "12", 5 | ! "12", 6 | # ! "12", 7 | ! "12", 8 | ] 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-07.data: -------------------------------------------------------------------------------- 1 | # Assuming conventional resolution: 2 | - "12" 3 | - 12 4 | - ! 12 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-08.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "foo" 5 | : !!str "bar baz" 6 | } 7 | %YAML 1.1 8 | --- 9 | !!str "foo bar" 10 | %YAML 1.1 11 | --- 12 | !!str "foo bar" 13 | %YAML 1.1 14 | --- 15 | !!str "foo\n" 16 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-08.data: -------------------------------------------------------------------------------- 1 | --- 2 | foo: 3 | "bar 4 | baz" 5 | --- 6 | "foo 7 | bar" 8 | --- 9 | foo 10 | bar 11 | --- | 12 | foo 13 | ... 14 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-09.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- !!map { 3 | ? !!str "scalars" : !!map { 4 | ? !!str "plain" 5 | : !!str "some text", 6 | ? !!str "quoted" 7 | : !!map { 8 | ? !!str "single" 9 | : !!str "some text", 10 | ? !!str "double" 11 | : !!str "some text" 12 | } }, 13 | ? !!str "collections" : !!map { 14 | ? !!str "sequence" : !!seq [ 15 | !!str "entry", 16 | !!map { 17 | ? !!str "key" : !!str "value" 18 | } ], 19 | ? !!str "mapping" : !!map { 20 | ? !!str "key" : !!str "value" 21 | } } } 22 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-09.data: -------------------------------------------------------------------------------- 1 | --- 2 | scalars: 3 | plain: !!str some text 4 | quoted: 5 | single: 'some text' 6 | double: "some text" 7 | collections: 8 | sequence: !!seq [ !!str entry, 9 | # Mapping entry: 10 | key: value ] 11 | mapping: { key: value } 12 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-10.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "block styles" : !!map { 5 | ? !!str "scalars" : !!map { 6 | ? !!str "literal" 7 | : !!str "#!/usr/bin/perl\n\ 8 | print \"Hello, 9 | world!\\n\";\n", 10 | ? !!str "folded" 11 | : !!str "This sentence 12 | is false.\n" 13 | }, 14 | ? !!str "collections" : !!map { 15 | ? !!str "sequence" : !!seq [ 16 | !!str "entry", 17 | !!map { 18 | ? !!str "key" : !!str "value" 19 | } 20 | ], 21 | ? !!str "mapping" : !!map { 22 | ? !!str "key" : !!str "value" 23 | } } } } 24 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-10.data: -------------------------------------------------------------------------------- 1 | block styles: 2 | scalars: 3 | literal: !!str | 4 | #!/usr/bin/perl 5 | print "Hello, world!\n"; 6 | folded: > 7 | This sentence 8 | is false. 9 | collections: !!map 10 | sequence: !!seq # Entry: 11 | - entry # Plain 12 | # Mapping entry: 13 | - key: value 14 | mapping: 15 | key: value 16 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-11.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "First occurrence" 5 | : &A !!str "Value", 6 | ? !!str "Second occurrence" 7 | : *A 8 | } 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-11.data: -------------------------------------------------------------------------------- 1 | First occurrence: &anchor Value 2 | Second occurrence: *anchor 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-12.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | !!str "Without properties", 5 | &A !!str "Anchored", 6 | !!str "Tagged", 7 | *A, 8 | !!str "", 9 | !!str "", 10 | ] 11 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-12.data: -------------------------------------------------------------------------------- 1 | [ 2 | Without properties, 3 | &anchor "Anchored", 4 | !!str 'Tagged', 5 | *anchor, # Alias node 6 | !!str , # Empty plain scalar 7 | '', # Empty plain scalar 8 | ] 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-13.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "foo" 5 | # : !!str "", 6 | # ? !!str "" 7 | : !!null "", 8 | ? !!null "" 9 | : !!str "bar", 10 | } 11 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-13.data: -------------------------------------------------------------------------------- 1 | { 2 | ? foo :, 3 | ? : bar, 4 | } 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-13.skip-ext: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaml/pyyaml/69c141adcf805c5ebdc9ba519927642ee5c7f639/tests/legacy_tests/data/spec-08-13.skip-ext -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-14.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | !!str "flow in block", 5 | !!str "Block scalar\n", 6 | !!map { 7 | ? !!str "foo" 8 | : !!str "bar" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-14.data: -------------------------------------------------------------------------------- 1 | - "flow in block" 2 | - > 3 | Block scalar 4 | - !!map # Block collection 5 | foo : bar 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-15.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | !!null "", 5 | !!map { 6 | ? !!str "foo" 7 | : !!null "", 8 | ? !!null "" 9 | : !!str "bar", 10 | } 11 | ] 12 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-08-15.data: -------------------------------------------------------------------------------- 1 | - # Empty plain scalar 2 | - ? foo 3 | : 4 | ? 5 | : bar 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-01.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "simple key" 5 | : !!map { 6 | ? !!str "also simple" 7 | : !!str "value", 8 | ? !!str "not a simple key" 9 | : !!str "any value" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-01.data: -------------------------------------------------------------------------------- 1 | "simple key" : { 2 | "also simple" : value, 3 | ? "not a 4 | simple key" : "any 5 | value" 6 | } 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-02.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "as space \ 4 | trimmed\n\ 5 | specific\L\n\ 6 | escaped\t\n\ 7 | none" 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-02.data: -------------------------------------------------------------------------------- 1 | "as space 2 | trimmed 3 | 4 | specific
 5 | escaped \
 6 | none" 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-03.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | !!str " last", 5 | !!str " last", 6 | !!str " \tfirst last", 7 | ] 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-03.data: -------------------------------------------------------------------------------- 1 | - " 2 | last" 3 | - " 4 | last" 5 | - " first 6 | last" 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-04.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "first \ 4 | inner 1 \ 5 | inner 2 \ 6 | last" 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-04.data: -------------------------------------------------------------------------------- 1 | "first 2 | inner 1 3 | \ inner 2 \ 4 | last" 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-05.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | !!str "first ", 5 | !!str "first\nlast", 6 | !!str "first inner \tlast", 7 | ] 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-05.data: -------------------------------------------------------------------------------- 1 | - "first 2 | " 3 | - "first 4 | 5 | last" 6 | - "first 7 | inner 8 | \ last" 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-06.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "here's to \"quotes\"" 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-06.data: -------------------------------------------------------------------------------- 1 | 'here''s to "quotes"' 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-07.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "simple key" 5 | : !!map { 6 | ? !!str "also simple" 7 | : !!str "value", 8 | ? !!str "not a simple key" 9 | : !!str "any value" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-07.data: -------------------------------------------------------------------------------- 1 | 'simple key' : { 2 | 'also simple' : value, 3 | ? 'not a 4 | simple key' : 'any 5 | value' 6 | } 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-08.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "as space \ 4 | trimmed\n\ 5 | specific\L\n\ 6 | none" 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-08.data: -------------------------------------------------------------------------------- 1 | 'as space … trimmed …… specific
… none' 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-09.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | !!str " last", 5 | !!str " last", 6 | !!str " \tfirst last", 7 | ] 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-09.data: -------------------------------------------------------------------------------- 1 | - ' 2 | last' 3 | - ' 4 | last' 5 | - ' first 6 | last' 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-10.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "first \ 4 | inner \ 5 | last" 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-10.data: -------------------------------------------------------------------------------- 1 | 'first 2 | inner 3 | last' 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-11.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | !!str "first ", 5 | !!str "first\nlast", 6 | ] 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-11.data: -------------------------------------------------------------------------------- 1 | - 'first 2 | ' 3 | - 'first 4 | 5 | last' 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-12.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | !!str "::std::vector", 5 | !!str "Up, up, and away!", 6 | !!int "-123", 7 | !!seq [ 8 | !!str "::std::vector", 9 | !!str "Up, up, and away!", 10 | !!int "-123", 11 | ] 12 | ] 13 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-12.data: -------------------------------------------------------------------------------- 1 | # Outside flow collection: 2 | - ::std::vector 3 | - Up, up, and away! 4 | - -123 5 | # Inside flow collection: 6 | - [ '::std::vector', 7 | "Up, up, and away!", 8 | -123 ] 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-13.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "simple key" 5 | : !!map { 6 | ? !!str "also simple" 7 | : !!str "value", 8 | ? !!str "not a simple key" 9 | : !!str "any value" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-13.data: -------------------------------------------------------------------------------- 1 | simple key : { 2 | also simple : value, 3 | ? not a 4 | simple key : any 5 | value 6 | } 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-14.data: -------------------------------------------------------------------------------- 1 | --- 2 | --- ||| : foo 3 | ... >>>: bar 4 | --- 5 | [ 6 | --- 7 | , 8 | ... , 9 | { 10 | --- : 11 | ... # Nested 12 | } 13 | ] 14 | ... 15 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-14.error: -------------------------------------------------------------------------------- 1 | ERROR: 2 | The --- and ... document 3 | start and end markers must 4 | not be specified as the 5 | first content line of a 6 | non-indented plain scalar. 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-15.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "---" 5 | : !!str "foo", 6 | ? !!str "..." 7 | : !!str "bar" 8 | } 9 | %YAML 1.1 10 | --- 11 | !!seq [ 12 | !!str "---", 13 | !!str "...", 14 | !!map { 15 | ? !!str "---" 16 | : !!str "..." 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-15.data: -------------------------------------------------------------------------------- 1 | --- 2 | "---" : foo 3 | ...: bar 4 | --- 5 | [ 6 | ---, 7 | ..., 8 | { 9 | ? --- 10 | : ... 11 | } 12 | ] 13 | ... 14 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-16.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "as space \ 4 | trimmed\n\ 5 | specific\L\n\ 6 | none" 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-16.data: -------------------------------------------------------------------------------- 1 | # Tabs are confusing: 2 | # as space/trimmed/specific/none 3 | as space … trimmed …… specific
… none 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-17.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "first line\n\ 4 | more line" 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-17.data: -------------------------------------------------------------------------------- 1 | first line 2 | 3 | more line 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-18.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | !!str "literal\n", 5 | !!str " folded\n", 6 | !!str "keep\n\n", 7 | !!str " strip", 8 | ] 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-18.data: -------------------------------------------------------------------------------- 1 | - | # Just the style 2 | literal 3 | - >1 # Indentation indicator 4 | folded 5 | - |+ # Chomping indicator 6 | keep 7 | 8 | - >-1 # Both indicators 9 | strip 10 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-19.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | !!str "literal\n", 5 | !!str "folded\n", 6 | ] 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-19.data: -------------------------------------------------------------------------------- 1 | - | 2 | literal 3 | - > 4 | folded 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-20.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | !!str "detected\n", 5 | !!str "\n\n# detected\n", 6 | !!str " explicit\n", 7 | !!str "\t\ndetected\n", 8 | ] 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-20.data: -------------------------------------------------------------------------------- 1 | - | 2 | detected 3 | - > 4 | 5 | 6 | # detected 7 | - |1 8 | explicit 9 | - > 10 | 11 | detected 12 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-20.skip-ext: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaml/pyyaml/69c141adcf805c5ebdc9ba519927642ee5c7f639/tests/legacy_tests/data/spec-09-20.skip-ext -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-21.data: -------------------------------------------------------------------------------- 1 | - | 2 | 3 | text 4 | - > 5 | text 6 | text 7 | - |1 8 | text 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-21.error: -------------------------------------------------------------------------------- 1 | ERROR: 2 | - A leading all-space line must 3 | not have too many spaces. 4 | - A following text line must 5 | not be less indented. 6 | - The text is less indented 7 | than the indicated level. 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-22.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "strip" 5 | : !!str "text", 6 | ? !!str "clip" 7 | : !!str "text\n", 8 | ? !!str "keep" 9 | : !!str "text\L", 10 | } 11 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-22.data: -------------------------------------------------------------------------------- 1 | strip: |- 2 | text
clip: | 3 | text…keep: |+ 4 | text
 -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-23.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "strip" 5 | : !!str "# text", 6 | ? !!str "clip" 7 | : !!str "# text\n", 8 | ? !!str "keep" 9 | : !!str "# text\L\n", 10 | } 11 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-23.data: -------------------------------------------------------------------------------- 1 | # Strip 2 | # Comments: 3 | strip: |- 4 | # text
 
 # Clip 5 | # comments: 6 | …clip: | 7 | # text… 
 # Keep 8 | # comments: 9 | …keep: |+ 10 | # text
… # Trail 11 | # comments. 12 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-24.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "strip" 5 | : !!str "", 6 | ? !!str "clip" 7 | : !!str "", 8 | ? !!str "keep" 9 | : !!str "\n", 10 | } 11 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-24.data: -------------------------------------------------------------------------------- 1 | strip: >- 2 | 3 | clip: > 4 | 5 | keep: |+ 6 | 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-25.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "literal\n\ 4 | \ttext\n" 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-25.data: -------------------------------------------------------------------------------- 1 | | # Simple block scalar 2 | literal 3 | text 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-26.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "\n\nliteral\n\ntext\n" 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-26.data: -------------------------------------------------------------------------------- 1 | | 2 | 3 | 4 | literal 5 | 6 | text 7 | 8 | # Comment 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-27.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "\n\nliteral\n\ntext\n" 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-27.data: -------------------------------------------------------------------------------- 1 | | 2 | 3 | 4 | literal 5 | 6 | text 7 | 8 | # Comment 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-28.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "\n\nliteral\n\ntext\n" 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-28.data: -------------------------------------------------------------------------------- 1 | | 2 | 3 | 4 | literal 5 | 6 | text 7 | 8 | # Comment 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-29.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "folded text\n\ 4 | \tlines\n" 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-29.data: -------------------------------------------------------------------------------- 1 | > # Simple folded scalar 2 | folded 3 | text 4 | lines 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-30.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "folded line\n\ 4 | next line\n\n\ 5 | \ * bullet\n\ 6 | \ * list\n\n\ 7 | last line\n" 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-30.data: -------------------------------------------------------------------------------- 1 | > 2 | folded 3 | line 4 | 5 | next 6 | line 7 | 8 | * bullet 9 | * list 10 | 11 | last 12 | line 13 | 14 | # Comment 15 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-31.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "folded line\n\ 4 | next line\n\n\ 5 | \ * bullet\n\ 6 | \ * list\n\n\ 7 | last line\n" 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-31.data: -------------------------------------------------------------------------------- 1 | > 2 | folded 3 | line 4 | 5 | next 6 | line 7 | 8 | * bullet 9 | * list 10 | 11 | last 12 | line 13 | 14 | # Comment 15 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-32.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "folded line\n\ 4 | next line\n\n\ 5 | \ * bullet\n\ 6 | \ * list\n\n\ 7 | last line\n" 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-32.data: -------------------------------------------------------------------------------- 1 | > 2 | folded 3 | line 4 | 5 | next 6 | line 7 | 8 | * bullet 9 | * list 10 | 11 | last 12 | line 13 | 14 | # Comment 15 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-33.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!str "folded line\n\ 4 | next line\n\n\ 5 | \ * bullet\n\ 6 | \ * list\n\n\ 7 | last line\n" 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-09-33.data: -------------------------------------------------------------------------------- 1 | > 2 | folded 3 | line 4 | 5 | next 6 | line 7 | 8 | * bullet 9 | * list 10 | 11 | last 12 | line 13 | 14 | # Comment 15 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-01.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | !!seq [ 5 | !!str "inner", 6 | !!str "inner", 7 | ], 8 | !!seq [ 9 | !!str "inner", 10 | !!str "last", 11 | ], 12 | ] 13 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-01.data: -------------------------------------------------------------------------------- 1 | - [ inner, inner, ] 2 | - [inner,last] 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-02.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | !!str "double quoted", 5 | !!str "single quoted", 6 | !!str "plain text", 7 | !!seq [ 8 | !!str "nested", 9 | ], 10 | !!map { 11 | ? !!str "single" 12 | : !!str "pair" 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-02.data: -------------------------------------------------------------------------------- 1 | [ 2 | "double 3 | quoted", 'single 4 | quoted', 5 | plain 6 | text, [ nested ], 7 | single: pair , 8 | ] 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-03.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "block" 5 | : !!seq [ 6 | !!str "one", 7 | !!map { 8 | ? !!str "two" 9 | : !!str "three" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-03.data: -------------------------------------------------------------------------------- 1 | block: # Block 2 | # sequence 3 | - one 4 | - two : three 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-04.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "block" 5 | : !!seq [ 6 | !!str "one", 7 | !!seq [ 8 | !!str "two" 9 | ] 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-04.data: -------------------------------------------------------------------------------- 1 | block: 2 | - one 3 | - 4 | - two 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-05.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | !!null "", 5 | !!str "block node\n", 6 | !!seq [ 7 | !!str "one", 8 | !!str "two", 9 | ], 10 | !!map { 11 | ? !!str "one" 12 | : !!str "two", 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-05.data: -------------------------------------------------------------------------------- 1 | - # Empty 2 | - | 3 | block node 4 | - - one # in-line 5 | - two # sequence 6 | - one: two # in-line 7 | # mapping 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-06.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | !!map { 5 | ? !!str "inner" 6 | : !!str "entry", 7 | ? !!str "also" 8 | : !!str "inner" 9 | }, 10 | !!map { 11 | ? !!str "inner" 12 | : !!str "entry", 13 | ? !!str "last" 14 | : !!str "entry" 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-06.data: -------------------------------------------------------------------------------- 1 | - { inner : entry , also: inner , } 2 | - {inner: entry,last : entry} 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-07.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!null "" 5 | : !!str "value", 6 | ? !!str "explicit key" 7 | : !!str "value", 8 | ? !!str "simple key" 9 | : !!str "value", 10 | ? !!seq [ 11 | !!str "collection", 12 | !!str "simple", 13 | !!str "key" 14 | ] 15 | : !!str "value" 16 | } 17 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-07.data: -------------------------------------------------------------------------------- 1 | { 2 | ? : value, # Empty key 3 | ? explicit 4 | key: value, 5 | simple key : value, 6 | [ collection, simple, key ]: value 7 | } 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-08.data: -------------------------------------------------------------------------------- 1 | { 2 | multi-line 3 | simple key : value, 4 | very long ...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................(>1KB)................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... key: value 5 | } 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-08.error: -------------------------------------------------------------------------------- 1 | ERROR: 2 | - A simple key is restricted 3 | to only one line. 4 | - A simple key must not be 5 | longer than 1024 characters. 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-09.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "key" 5 | : !!str "value", 6 | ? !!str "empty" 7 | : !!null "", 8 | } 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-09.data: -------------------------------------------------------------------------------- 1 | { 2 | key : value, 3 | empty: # empty value↓ 4 | } 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-10.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "explicit key1" 5 | : !!str "explicit value", 6 | ? !!str "explicit key2" 7 | : !!null "", 8 | ? !!str "explicit key3" 9 | : !!null "", 10 | ? !!str "simple key1" 11 | : !!str "explicit value", 12 | ? !!str "simple key2" 13 | : !!null "", 14 | ? !!str "simple key3" 15 | : !!null "", 16 | } 17 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-10.data: -------------------------------------------------------------------------------- 1 | { 2 | ? explicit key1 : explicit value, 3 | ? explicit key2 : , # Explicit empty 4 | ? explicit key3, # Empty value 5 | simple key1 : explicit value, 6 | simple key2 : , # Explicit empty 7 | simple key3, # Empty value 8 | } 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-11.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | !!map { 5 | ? !!str "explicit key1" 6 | : !!str "explicit value", 7 | }, 8 | !!map { 9 | ? !!str "explicit key2" 10 | : !!null "", 11 | }, 12 | !!map { 13 | ? !!str "explicit key3" 14 | : !!null "", 15 | }, 16 | !!map { 17 | ? !!str "simple key1" 18 | : !!str "explicit value", 19 | }, 20 | !!map { 21 | ? !!str "simple key2" 22 | : !!null "", 23 | }, 24 | ] 25 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-11.data: -------------------------------------------------------------------------------- 1 | [ 2 | ? explicit key1 : explicit value, 3 | ? explicit key2 : , # Explicit empty 4 | ? explicit key3, # Implicit empty 5 | simple key1 : explicit value, 6 | simple key2 : , # Explicit empty 7 | ] 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-12.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "block" 5 | : !!map { 6 | ? !!str "key" 7 | : !!str "value" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-12.data: -------------------------------------------------------------------------------- 1 | block: # Block 2 | # mapping 3 | key: value 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-13.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "explicit key" 5 | : !!null "", 6 | ? !!str "block key\n" 7 | : !!seq [ 8 | !!str "one", 9 | !!str "two", 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-13.data: -------------------------------------------------------------------------------- 1 | ? explicit key # implicit value 2 | ? | 3 | block key 4 | : - one # explicit in-line 5 | - two # block value 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-14.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!map { 4 | ? !!str "plain key" 5 | : !!null "", 6 | ? !!str "quoted key" 7 | : !!seq [ 8 | !!str "one", 9 | !!str "two", 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-14.data: -------------------------------------------------------------------------------- 1 | plain key: # empty value 2 | "quoted key": 3 | - one # explicit next-line 4 | - two # block value 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-15.canonical: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | --- 3 | !!seq [ 4 | !!map { 5 | ? !!str "sun" 6 | : !!str "yellow" 7 | }, 8 | !!map { 9 | ? !!map { 10 | ? !!str "earth" 11 | : !!str "blue" 12 | } 13 | : !!map { 14 | ? !!str "moon" 15 | : !!str "white" 16 | } 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/spec-10-15.data: -------------------------------------------------------------------------------- 1 | - sun: yellow 2 | - ? earth: blue 3 | : moon: white 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/str.data: -------------------------------------------------------------------------------- 1 | - abcd 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/str.detect: -------------------------------------------------------------------------------- 1 | tag:yaml.org,2002:str 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/tags.events: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | - !DocumentStart 3 | - !SequenceStart 4 | - !Scalar { value: 'data' } 5 | #- !Scalar { tag: '!', value: 'data' } 6 | - !Scalar { tag: 'tag:yaml.org,2002:str', value: 'data' } 7 | - !Scalar { tag: '!myfunnytag', value: 'data' } 8 | - !Scalar { tag: '!my!ugly!tag', value: 'data' } 9 | - !Scalar { tag: 'tag:my.domain.org,2002:data!? #', value: 'data' } 10 | - !SequenceEnd 11 | - !DocumentEnd 12 | - !StreamEnd 13 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/test_mark.marks: -------------------------------------------------------------------------------- 1 | --- 2 | *The first line. 3 | The last line. 4 | --- 5 | The first*line. 6 | The last line. 7 | --- 8 | The first line.* 9 | The last line. 10 | --- 11 | The first line. 12 | *The last line. 13 | --- 14 | The first line. 15 | The last*line. 16 | --- 17 | The first line. 18 | The last line.* 19 | --- 20 | The first line. 21 | *The selected line. 22 | The last line. 23 | --- 24 | The first line. 25 | The selected*line. 26 | The last line. 27 | --- 28 | The first line. 29 | The selected line.* 30 | The last line. 31 | --- 32 | *The only line. 33 | --- 34 | The only*line. 35 | --- 36 | The only line.* 37 | --- 38 | Loooooooooooooooooooooooooooooooooooooooooooooong*Liiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiine 39 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/timestamp-bugs.code: -------------------------------------------------------------------------------- 1 | [ 2 | [datetime.datetime(2001, 12, 15, 3, 29, 43, 100000), 'UTC-05:30'], 3 | [datetime.datetime(2001, 12, 14, 16, 29, 43, 100000), 'UTC+05:30'], 4 | [datetime.datetime(2001, 12, 14, 21, 59, 43, 1010), None], 5 | [datetime.datetime(2001, 12, 14, 21, 59, 43, 0, FixedOffset(60, "+1")), 'UTC+01:00'], 6 | [datetime.datetime(2001, 12, 14, 21, 59, 43, 0, FixedOffset(-90, "-1:30")), 'UTC-01:30'], 7 | [datetime.datetime(2005, 7, 8, 17, 35, 4, 517600), None], 8 | ] 9 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/timestamp-bugs.data: -------------------------------------------------------------------------------- 1 | - !MyTime 2 | - 2001-12-14 21:59:43.10 -5:30 3 | - !MyTime 4 | - 2001-12-14 21:59:43.10 +5:30 5 | - !MyTime 6 | - 2001-12-14 21:59:43.00101 7 | - !MyTime 8 | - 2001-12-14 21:59:43+1 9 | - !MyTime 10 | - 2001-12-14 21:59:43-1:30 11 | - !MyTime 12 | - 2005-07-08 17:35:04.517600 13 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/timestamp.data: -------------------------------------------------------------------------------- 1 | - 2001-12-15T02:59:43.1Z 2 | - 2001-12-14t21:59:43.10-05:00 3 | - 2001-12-14 21:59:43.10 -5 4 | - 2001-12-15 2:59:43.10 5 | - 2002-12-14 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/timestamp.detect: -------------------------------------------------------------------------------- 1 | tag:yaml.org,2002:timestamp 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/unacceptable-key.loader-error: -------------------------------------------------------------------------------- 1 | --- 2 | ? - foo 3 | - bar 4 | : baz 5 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/unclosed-bracket.loader-error: -------------------------------------------------------------------------------- 1 | test: 2 | - [ foo: bar 3 | # comment the rest of the stream to let the scanner detect the problem. 4 | # - baz 5 | #"we could have detected the unclosed bracket on the above line, but this would forbid such syntax as": { 6 | #} 7 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/unclosed-quoted-scalar.loader-error: -------------------------------------------------------------------------------- 1 | 'foo 2 | bar 3 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/undefined-anchor.loader-error: -------------------------------------------------------------------------------- 1 | - foo 2 | - &bar baz 3 | - *bat 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/undefined-constructor.loader-error: -------------------------------------------------------------------------------- 1 | --- !foo bar 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/undefined-tag-handle.loader-error: -------------------------------------------------------------------------------- 1 | --- !foo!bar baz 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/unknown.dumper-error: -------------------------------------------------------------------------------- 1 | yaml.safe_dump(object) 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/unsupported-version.emitter-error: -------------------------------------------------------------------------------- 1 | - !StreamStart 2 | - !DocumentStart { version: [5,6] } 3 | - !Scalar { value: foo } 4 | - !DocumentEnd 5 | - !StreamEnd 6 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/utf16be.code: -------------------------------------------------------------------------------- 1 | "UTF-16-BE" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/utf16be.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaml/pyyaml/69c141adcf805c5ebdc9ba519927642ee5c7f639/tests/legacy_tests/data/utf16be.data -------------------------------------------------------------------------------- /tests/legacy_tests/data/utf16le.code: -------------------------------------------------------------------------------- 1 | "UTF-16-LE" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/utf16le.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaml/pyyaml/69c141adcf805c5ebdc9ba519927642ee5c7f639/tests/legacy_tests/data/utf16le.data -------------------------------------------------------------------------------- /tests/legacy_tests/data/utf8-implicit.code: -------------------------------------------------------------------------------- 1 | "implicit UTF-8" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/utf8-implicit.data: -------------------------------------------------------------------------------- 1 | --- implicit UTF-8 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/utf8.code: -------------------------------------------------------------------------------- 1 | "UTF-8" 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/utf8.data: -------------------------------------------------------------------------------- 1 | --- UTF-8 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/value.data: -------------------------------------------------------------------------------- 1 | - = 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/value.detect: -------------------------------------------------------------------------------- 1 | tag:yaml.org,2002:value 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/yaml.data: -------------------------------------------------------------------------------- 1 | - !!yaml '!' 2 | - !!yaml '&' 3 | - !!yaml '*' 4 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/yaml.detect: -------------------------------------------------------------------------------- 1 | tag:yaml.org,2002:yaml 2 | -------------------------------------------------------------------------------- /tests/legacy_tests/data/yaml11.schema-skip: -------------------------------------------------------------------------------- 1 | load: { 2 | 'Y': 1, 'y': 1, 'N': 1, 'n': 1, 3 | '!!bool Y': 1, '!!bool N': 1, '!!bool n': 1, '!!bool y': 1, 4 | } 5 | dump: { 6 | '!!str N': 1, '!!str Y': 1, '!!str n': 1, '!!str y': 1, 7 | } 8 | -------------------------------------------------------------------------------- /tests/legacy_tests/test_all.py: -------------------------------------------------------------------------------- 1 | 2 | import sys, yaml, test_appliance 3 | 4 | def main(args=None): 5 | collections = [] 6 | import test_yaml 7 | collections.append(test_yaml) 8 | if yaml.__with_libyaml__: 9 | import test_yaml_ext 10 | collections.append(test_yaml_ext) 11 | return test_appliance.run(collections, args) 12 | 13 | if __name__ == '__main__': 14 | main() 15 | 16 | -------------------------------------------------------------------------------- /tests/legacy_tests/test_build.py: -------------------------------------------------------------------------------- 1 | 2 | if __name__ == '__main__': 3 | import sys, os, distutils.util 4 | build_lib = 'build/lib' 5 | build_lib_ext = os.path.join('build', 'lib.{}-{}.{}'.format(distutils.util.get_platform(), *sys.version_info)) 6 | sys.path.insert(0, build_lib) 7 | sys.path.insert(0, build_lib_ext) 8 | import test_yaml, test_appliance 9 | test_appliance.run(test_yaml) 10 | 11 | -------------------------------------------------------------------------------- /tests/legacy_tests/test_build_ext.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | if __name__ == '__main__': 4 | import sys, os, distutils.util 5 | build_lib = 'build/lib' 6 | build_lib_ext = os.path.join('build', 'lib.{}-{}.{}'.format(distutils.util.get_platform(), *sys.version_info)) 7 | sys.path.insert(0, build_lib) 8 | sys.path.insert(0, build_lib_ext) 9 | import test_yaml_ext, test_appliance 10 | test_appliance.run(test_yaml_ext) 11 | 12 | -------------------------------------------------------------------------------- /tests/legacy_tests/test_canonical.py: -------------------------------------------------------------------------------- 1 | 2 | import yaml, canonical 3 | 4 | def test_canonical_scanner(canonical_filename, verbose=False): 5 | with open(canonical_filename, 'rb') as file: 6 | data = file.read() 7 | tokens = list(yaml.canonical_scan(data)) 8 | assert tokens, tokens 9 | if verbose: 10 | for token in tokens: 11 | print(token) 12 | 13 | test_canonical_scanner.unittest = ['.canonical'] 14 | 15 | def test_canonical_parser(canonical_filename, verbose=False): 16 | with open(canonical_filename, 'rb') as file: 17 | data = file.read() 18 | events = list(yaml.canonical_parse(data)) 19 | assert events, events 20 | if verbose: 21 | for event in events: 22 | print(event) 23 | 24 | test_canonical_parser.unittest = ['.canonical'] 25 | 26 | def test_canonical_error(data_filename, canonical_filename, verbose=False): 27 | with open(data_filename, 'rb') as file: 28 | data = file.read() 29 | try: 30 | output = list(yaml.canonical_load_all(data)) 31 | except yaml.YAMLError as exc: 32 | if verbose: 33 | print(exc) 34 | else: 35 | raise AssertionError("expected an exception") 36 | 37 | test_canonical_error.unittest = ['.data', '.canonical'] 38 | test_canonical_error.skip = ['.empty'] 39 | 40 | if __name__ == '__main__': 41 | import test_appliance 42 | test_appliance.run(globals()) 43 | 44 | -------------------------------------------------------------------------------- /tests/legacy_tests/test_errors.py: -------------------------------------------------------------------------------- 1 | 2 | import yaml, test_emitter 3 | 4 | def test_loader_error(error_filename, verbose=False): 5 | try: 6 | with open(error_filename, 'rb') as file: 7 | list(yaml.load_all(file, yaml.FullLoader)) 8 | except yaml.YAMLError as exc: 9 | if verbose: 10 | print("%s:" % exc.__class__.__name__, exc) 11 | else: 12 | raise AssertionError("expected an exception") 13 | 14 | test_loader_error.unittest = ['.loader-error'] 15 | 16 | def test_loader_error_string(error_filename, verbose=False): 17 | try: 18 | with open(error_filename, 'rb') as file: 19 | list(yaml.load_all(file.read(), yaml.FullLoader)) 20 | except yaml.YAMLError as exc: 21 | if verbose: 22 | print("%s:" % exc.__class__.__name__, exc) 23 | else: 24 | raise AssertionError("expected an exception") 25 | 26 | test_loader_error_string.unittest = ['.loader-error'] 27 | 28 | def test_loader_error_single(error_filename, verbose=False): 29 | try: 30 | with open(error_filename, 'rb') as file: 31 | yaml.load(file.read(), yaml.FullLoader) 32 | except yaml.YAMLError as exc: 33 | if verbose: 34 | print("%s:" % exc.__class__.__name__, exc) 35 | else: 36 | raise AssertionError("expected an exception") 37 | 38 | test_loader_error_single.unittest = ['.single-loader-error'] 39 | 40 | def test_emitter_error(error_filename, verbose=False): 41 | with open(error_filename, 'rb') as file: 42 | events = list(yaml.load(file, Loader=test_emitter.EventsLoader)) 43 | try: 44 | yaml.emit(events) 45 | except yaml.YAMLError as exc: 46 | if verbose: 47 | print("%s:" % exc.__class__.__name__, exc) 48 | else: 49 | raise AssertionError("expected an exception") 50 | 51 | test_emitter_error.unittest = ['.emitter-error'] 52 | 53 | def test_dumper_error(error_filename, verbose=False): 54 | with open(error_filename, 'rb') as file: 55 | code = file.read() 56 | try: 57 | import yaml 58 | from io import StringIO 59 | exec(code) 60 | except yaml.YAMLError as exc: 61 | if verbose: 62 | print("%s:" % exc.__class__.__name__, exc) 63 | else: 64 | raise AssertionError("expected an exception") 65 | 66 | test_dumper_error.unittest = ['.dumper-error'] 67 | 68 | if __name__ == '__main__': 69 | import test_appliance 70 | test_appliance.run(globals()) 71 | 72 | -------------------------------------------------------------------------------- /tests/legacy_tests/test_mark.py: -------------------------------------------------------------------------------- 1 | 2 | import yaml 3 | 4 | def test_marks(marks_filename, verbose=False): 5 | with open(marks_filename, 'r') as file: 6 | inputs = file.read().split('---\n')[1:] 7 | for input in inputs: 8 | index = 0 9 | line = 0 10 | column = 0 11 | while input[index] != '*': 12 | if input[index] == '\n': 13 | line += 1 14 | column = 0 15 | else: 16 | column += 1 17 | index += 1 18 | mark = yaml.Mark(marks_filename, index, line, column, input, index) 19 | snippet = mark.get_snippet(indent=2, max_length=79) 20 | if verbose: 21 | print(snippet) 22 | assert isinstance(snippet, str), type(snippet) 23 | assert snippet.count('\n') == 1, snippet.count('\n') 24 | data, pointer = snippet.split('\n') 25 | assert len(data) < 82, len(data) 26 | assert data[len(pointer)-1] == '*', data[len(pointer)-1] 27 | 28 | test_marks.unittest = ['.marks'] 29 | 30 | if __name__ == '__main__': 31 | import test_appliance 32 | test_appliance.run(globals()) 33 | 34 | -------------------------------------------------------------------------------- /tests/legacy_tests/test_multi_constructor.py: -------------------------------------------------------------------------------- 1 | import yaml 2 | import pprint 3 | import sys 4 | 5 | def _load_code(expression): 6 | return eval(expression) 7 | 8 | def myconstructor1(constructor, tag, node): 9 | seq = constructor.construct_sequence(node) 10 | return {tag: seq } 11 | 12 | def myconstructor2(constructor, tag, node): 13 | seq = constructor.construct_sequence(node) 14 | string = '' 15 | try: 16 | i = tag.index('!') + 1 17 | except: 18 | try: 19 | i = tag.rindex(':') + 1 20 | except: 21 | pass 22 | if i >= 0: 23 | tag = tag[i:] 24 | return { tag: seq } 25 | 26 | class Multi1(yaml.FullLoader): 27 | pass 28 | class Multi2(yaml.FullLoader): 29 | pass 30 | 31 | def test_multi_constructor(input_filename, code_filename, verbose=False): 32 | with open(input_filename, 'rb') as file: 33 | input = file.read().decode('utf-8') 34 | with open(code_filename, 'rb') as file: 35 | native = _load_code(file.read()) 36 | 37 | # default multi constructor for ! and !! tags 38 | Multi1.add_multi_constructor('!', myconstructor1) 39 | Multi1.add_multi_constructor('tag:yaml.org,2002:', myconstructor1) 40 | 41 | data = yaml.load(input, Loader=Multi1) 42 | if verbose: 43 | print('Multi1:') 44 | print(data) 45 | print(native) 46 | assert(data == native) 47 | 48 | 49 | # default multi constructor for all tags 50 | Multi2.add_multi_constructor(None, myconstructor2) 51 | 52 | data = yaml.load(input, Loader=Multi2) 53 | if verbose: 54 | print('Multi2:') 55 | print(data) 56 | print(native) 57 | assert(data == native) 58 | 59 | 60 | test_multi_constructor.unittest = ['.multi', '.code'] 61 | 62 | if __name__ == '__main__': 63 | import test_appliance 64 | test_appliance.run(globals()) 65 | 66 | -------------------------------------------------------------------------------- /tests/legacy_tests/test_reader.py: -------------------------------------------------------------------------------- 1 | 2 | import yaml.reader 3 | 4 | def _run_reader(data, verbose): 5 | try: 6 | stream = yaml.reader.Reader(data) 7 | while stream.peek() != '\0': 8 | stream.forward() 9 | except yaml.reader.ReaderError as exc: 10 | if verbose: 11 | print(exc) 12 | else: 13 | raise AssertionError("expected an exception") 14 | 15 | def test_stream_error(error_filename, verbose=False): 16 | with open(error_filename, 'rb') as file: 17 | _run_reader(file, verbose) 18 | with open(error_filename, 'rb') as file: 19 | _run_reader(file.read(), verbose) 20 | for encoding in ['utf-8', 'utf-16-le', 'utf-16-be']: 21 | try: 22 | with open(error_filename, 'rb') as file: 23 | data = file.read().decode(encoding) 24 | break 25 | except UnicodeDecodeError: 26 | pass 27 | else: 28 | return 29 | _run_reader(data, verbose) 30 | with open(error_filename, encoding=encoding) as file: 31 | _run_reader(file, verbose) 32 | 33 | test_stream_error.unittest = ['.stream-error'] 34 | 35 | if __name__ == '__main__': 36 | import test_appliance 37 | test_appliance.run(globals()) 38 | 39 | -------------------------------------------------------------------------------- /tests/legacy_tests/test_recursive.py: -------------------------------------------------------------------------------- 1 | 2 | import yaml 3 | 4 | class AnInstance: 5 | 6 | def __init__(self, foo, bar): 7 | self.foo = foo 8 | self.bar = bar 9 | 10 | def __repr__(self): 11 | try: 12 | return "%s(foo=%r, bar=%r)" % (self.__class__.__name__, 13 | self.foo, self.bar) 14 | except RuntimeError: 15 | return "%s(foo=..., bar=...)" % self.__class__.__name__ 16 | 17 | class AnInstanceWithState(AnInstance): 18 | 19 | def __getstate__(self): 20 | return {'attributes': [self.foo, self.bar]} 21 | 22 | def __setstate__(self, state): 23 | self.foo, self.bar = state['attributes'] 24 | 25 | def test_recursive(recursive_filename, verbose=False): 26 | context = globals().copy() 27 | with open(recursive_filename, 'rb') as file: 28 | exec(file.read(), context) 29 | value1 = context['value'] 30 | output1 = None 31 | value2 = None 32 | output2 = None 33 | try: 34 | output1 = yaml.dump(value1) 35 | value2 = yaml.unsafe_load(output1) 36 | output2 = yaml.dump(value2) 37 | assert output1 == output2, (output1, output2) 38 | finally: 39 | if verbose: 40 | print("VALUE1:", value1) 41 | print("VALUE2:", value2) 42 | print("OUTPUT1:") 43 | print(output1) 44 | print("OUTPUT2:") 45 | print(output2) 46 | 47 | test_recursive.unittest = ['.recursive'] 48 | 49 | if __name__ == '__main__': 50 | import test_appliance 51 | test_appliance.run(globals()) 52 | 53 | -------------------------------------------------------------------------------- /tests/legacy_tests/test_representer.py: -------------------------------------------------------------------------------- 1 | 2 | import yaml 3 | import test_constructor 4 | import pprint 5 | 6 | def test_representer_types(code_filename, verbose=False): 7 | test_constructor._make_objects() 8 | for allow_unicode in [False, True]: 9 | for encoding in ['utf-8', 'utf-16-be', 'utf-16-le']: 10 | with open(code_filename, 'rb') as file: 11 | native1 = test_constructor._load_code(file.read()) 12 | native2 = None 13 | try: 14 | output = yaml.dump(native1, Dumper=test_constructor.MyDumper, 15 | allow_unicode=allow_unicode, encoding=encoding) 16 | native2 = yaml.load(output, Loader=test_constructor.MyLoader) 17 | try: 18 | if native1 == native2: 19 | continue 20 | except TypeError: 21 | pass 22 | value1 = test_constructor._serialize_value(native1) 23 | value2 = test_constructor._serialize_value(native2) 24 | if verbose: 25 | print("SERIALIZED NATIVE1:") 26 | print(value1) 27 | print("SERIALIZED NATIVE2:") 28 | print(value2) 29 | assert value1 == value2, (native1, native2) 30 | finally: 31 | if verbose: 32 | print("NATIVE1:") 33 | pprint.pprint(native1) 34 | print("NATIVE2:") 35 | pprint.pprint(native2) 36 | print("OUTPUT:") 37 | print(output) 38 | 39 | test_representer_types.unittest = ['.code'] 40 | 41 | if __name__ == '__main__': 42 | import test_appliance 43 | test_appliance.run(globals()) 44 | 45 | -------------------------------------------------------------------------------- /tests/legacy_tests/test_sort_keys.py: -------------------------------------------------------------------------------- 1 | import yaml 2 | import pprint 3 | import sys 4 | 5 | def test_sort_keys(input_filename, sorted_filename, verbose=False): 6 | with open(input_filename, 'rb') as file: 7 | input = file.read().decode('utf-8') 8 | with open(sorted_filename, 'rb') as file: 9 | sorted = file.read().decode('utf-8') 10 | data = yaml.load(input, Loader=yaml.FullLoader) 11 | dump_sorted = yaml.dump(data, default_flow_style=False, sort_keys=True) 12 | dump_unsorted = yaml.dump(data, default_flow_style=False, sort_keys=False) 13 | dump_unsorted_safe = yaml.dump(data, default_flow_style=False, sort_keys=False, Dumper=yaml.SafeDumper) 14 | if verbose: 15 | print("INPUT:") 16 | print(input) 17 | print("DATA:") 18 | print(data) 19 | 20 | assert dump_sorted == sorted 21 | 22 | if sys.version_info>=(3,7): 23 | assert dump_unsorted == input 24 | assert dump_unsorted_safe == input 25 | 26 | test_sort_keys.unittest = ['.sort', '.sorted'] 27 | 28 | if __name__ == '__main__': 29 | import test_appliance 30 | test_appliance.run(globals()) 31 | 32 | -------------------------------------------------------------------------------- /tests/legacy_tests/test_tokens.py: -------------------------------------------------------------------------------- 1 | 2 | import yaml 3 | import pprint 4 | 5 | # Tokens mnemonic: 6 | # directive: % 7 | # document_start: --- 8 | # document_end: ... 9 | # alias: * 10 | # anchor: & 11 | # tag: ! 12 | # scalar _ 13 | # block_sequence_start: [[ 14 | # block_mapping_start: {{ 15 | # block_end: ]} 16 | # flow_sequence_start: [ 17 | # flow_sequence_end: ] 18 | # flow_mapping_start: { 19 | # flow_mapping_end: } 20 | # entry: , 21 | # key: ? 22 | # value: : 23 | 24 | _replaces = { 25 | yaml.DirectiveToken: '%', 26 | yaml.DocumentStartToken: '---', 27 | yaml.DocumentEndToken: '...', 28 | yaml.AliasToken: '*', 29 | yaml.AnchorToken: '&', 30 | yaml.TagToken: '!', 31 | yaml.ScalarToken: '_', 32 | yaml.BlockSequenceStartToken: '[[', 33 | yaml.BlockMappingStartToken: '{{', 34 | yaml.BlockEndToken: ']}', 35 | yaml.FlowSequenceStartToken: '[', 36 | yaml.FlowSequenceEndToken: ']', 37 | yaml.FlowMappingStartToken: '{', 38 | yaml.FlowMappingEndToken: '}', 39 | yaml.BlockEntryToken: ',', 40 | yaml.FlowEntryToken: ',', 41 | yaml.KeyToken: '?', 42 | yaml.ValueToken: ':', 43 | } 44 | 45 | def test_tokens(data_filename, tokens_filename, verbose=False): 46 | tokens1 = [] 47 | with open(tokens_filename, 'r') as file: 48 | tokens2 = file.read().split() 49 | try: 50 | with open(data_filename, 'rb') as file: 51 | for token in yaml.scan(file): 52 | if not isinstance(token, (yaml.StreamStartToken, yaml.StreamEndToken)): 53 | tokens1.append(_replaces[token.__class__]) 54 | finally: 55 | if verbose: 56 | print("TOKENS1:", ' '.join(tokens1)) 57 | print("TOKENS2:", ' '.join(tokens2)) 58 | assert len(tokens1) == len(tokens2), (tokens1, tokens2) 59 | for token1, token2 in zip(tokens1, tokens2): 60 | assert token1 == token2, (token1, token2) 61 | 62 | test_tokens.unittest = ['.data', '.tokens'] 63 | 64 | def test_scanner(data_filename, canonical_filename, verbose=False): 65 | for filename in [data_filename, canonical_filename]: 66 | tokens = [] 67 | try: 68 | with open(filename, 'rb') as file: 69 | for token in yaml.scan(file): 70 | tokens.append(token.__class__.__name__) 71 | finally: 72 | if verbose: 73 | pprint.pprint(tokens) 74 | 75 | test_scanner.unittest = ['.data', '.canonical'] 76 | 77 | if __name__ == '__main__': 78 | import test_appliance 79 | test_appliance.run(globals()) 80 | 81 | -------------------------------------------------------------------------------- /tests/legacy_tests/test_yaml.py: -------------------------------------------------------------------------------- 1 | from test_mark import * 2 | from test_reader import * 3 | from test_canonical import * 4 | from test_tokens import * 5 | from test_structure import * 6 | from test_errors import * 7 | from test_resolver import * 8 | from test_constructor import * 9 | from test_emitter import * 10 | from test_representer import * 11 | from test_recursive import * 12 | from test_input_output import * 13 | from test_sort_keys import * 14 | from test_multi_constructor import * 15 | 16 | from test_schema import * 17 | 18 | if __name__ == '__main__': 19 | import test_appliance 20 | test_appliance.run(globals()) 21 | 22 | -------------------------------------------------------------------------------- /tests/test_dump_load.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import yaml 3 | 4 | 5 | def test_dump(): 6 | assert yaml.dump(['foo']) 7 | 8 | 9 | def test_load_no_loader(): 10 | with pytest.raises(TypeError): 11 | yaml.load("- foo\n") 12 | 13 | 14 | def test_load_safeloader(): 15 | assert yaml.load("- foo\n", Loader=yaml.SafeLoader) 16 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = py38,py39,py310,py311,py312 3 | 4 | [testenv] 5 | deps = 6 | pytest 7 | commands = 8 | pytest 9 | 10 | -------------------------------------------------------------------------------- /yaml/__init__.pxd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaml/pyyaml/69c141adcf805c5ebdc9ba519927642ee5c7f639/yaml/__init__.pxd -------------------------------------------------------------------------------- /yaml/_yaml.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #define PyUnicode_FromYamlString(s) PyUnicode_FromString((const char *)(void *)(s)) 5 | #define PyBytes_AS_Yaml_STRING(s) ((yaml_char_t *)PyBytes_AS_STRING(s)) 6 | 7 | #ifdef _MSC_VER /* MS Visual C++ 6.0 */ 8 | #if _MSC_VER == 1200 9 | 10 | #define PyLong_FromUnsignedLongLong(z) PyInt_FromLong(i) 11 | 12 | #endif 13 | #endif 14 | --------------------------------------------------------------------------------