llvm-project/llvm/test/YAMLParser/plain-characters.test
akirchhoff-modular 4480e650b3
[YAMLParser] Improve plain scalar spec compliance (#68946)
The `YAMLParser.h` header file claims support for YAML 1.2 with a few
deviations, but our plain scalar parsing failed to parse some valid YAML
according to the spec. This change puts us more in compliance with the
YAML spec, now letting us parse plain scalars containing additional
special characters in cases where they are not ambiguous.
2023-10-17 11:28:14 -06:00

31 lines
807 B
Plaintext

# RUN: yaml-bench -canonical %s | FileCheck %s
# Example from https://yaml.org/spec/1.2.2/#example-plain-characters
# Outside flow collection:
- ::vector
- ": - ()"
- Up, up, and away!
- -123
- https://example.com/foo#bar
# Inside flow collection:
- [ ::vector,
": - ()",
"Up, up and away!",
-123,
https://example.com/foo#bar ]
# CHECK: !!seq [
# CHECK-NEXT: !!str "::vector",
# CHECK-NEXT: !!str ": - ()",
# CHECK-NEXT: !!str "Up, up, and away!",
# CHECK-NEXT: !!str "-123",
# CHECK-NEXT: !!str "https://example.com/foo#bar",
# CHECK-NEXT: !!seq [
# CHECK-NEXT: !!str "::vector",
# CHECK-NEXT: !!str ": - ()",
# CHECK-NEXT: !!str "Up, up and away!",
# CHECK-NEXT: !!str "-123",
# CHECK-NEXT: !!str "https://example.com/foo#bar",
# CHECK-NEXT: ],
# CHECK-NEXT: ]