···11+# Basic Anchor and Alias Test Cases
22+# Tests fundamental anchor (&) and alias (*) functionality
33+44+# Test 1: Simple scalar anchor and alias
55+---
66+scalar_anchor: &simple_scalar "Hello, World!"
77+scalar_alias: *simple_scalar
88+# Expected: both should have the value "Hello, World!"
99+1010+# Test 2: Numeric scalar anchor
1111+---
1212+original: &num 42
1313+copy: *num
1414+another_copy: *num
1515+# Expected: all three should have the value 42
1616+1717+# Test 3: Sequence anchor and alias
1818+---
1919+original_list: &my_list
2020+ - apple
2121+ - banana
2222+ - cherry
2323+2424+copied_list: *my_list
2525+# Expected: both lists should be identical
2626+2727+# Test 4: Mapping anchor and alias
2828+---
2929+original_map: &person
3030+ name: Alice
3131+ age: 30
3232+ city: London
3333+3434+copied_map: *person
3535+# Expected: both maps should be identical
3636+3737+# Test 5: Multiple anchors in same document
3838+---
3939+defaults: &defaults
4040+ timeout: 30
4141+ retries: 3
4242+4343+colors: &colors
4444+ - red
4545+ - green
4646+ - blue
4747+4848+config:
4949+ settings: *defaults
5050+ palette: *colors
5151+# Expected: config.settings should have timeout and retries, config.palette should have the color list
5252+5353+# Test 6: Nested structure with anchor
5454+---
5555+template: &template
5656+ metadata:
5757+ version: 1.0
5858+ author: John Doe
5959+ settings:
6060+ enabled: true
6161+ debug: false
6262+6363+instance1: *template
6464+instance2: *template
6565+# Expected: both instances should be identical copies of template
6666+6767+# Test 7: Anchor in sequence
6868+---
6969+items:
7070+ - &first_item
7171+ id: 1
7272+ name: First
7373+ - id: 2
7474+ name: Second
7575+ - *first_item
7676+# Expected: first and third items should be identical
7777+7878+# Test 8: Multiple uses of same alias
7979+---
8080+shared_value: &shared 100
8181+calculations:
8282+ base: *shared
8383+ doubled: 200 # Just a value, not calculated
8484+ reference: *shared
8585+ another_ref: *shared
8686+# Expected: base, reference, and another_ref should all be 100
8787+8888+# Test 9: Boolean anchor
8989+---
9090+feature_flag: &enabled true
9191+features:
9292+ login: *enabled
9393+ signup: *enabled
9494+ export: *enabled
9595+# Expected: all features should be true
9696+9797+# Test 10: Null anchor
9898+---
9999+empty: &null_value ~
100100+values:
101101+ first: *null_value
102102+ second: *null_value
103103+# Expected: all should be null
104104+105105+# Test 11: String with special characters
106106+---
107107+message: &msg |
108108+ This is a multi-line
109109+ message with some
110110+ special content!
111111+112112+output1: *msg
113113+output2: *msg
114114+# Expected: both outputs should have the same multi-line string
115115+116116+# Test 12: Anchor in mapping value
117117+---
118118+database:
119119+ primary: &db_config
120120+ host: localhost
121121+ port: 5432
122122+ ssl: true
123123+ replica: *db_config
124124+ backup: *db_config
125125+# Expected: primary, replica, and backup should all have identical configuration
+194
yaml/ocaml-yamle/tests/yaml/anchors_merge.yml
···11+# Merge Key Test Cases
22+# Tests YAML 1.1 merge key (<<) functionality
33+# Note: Merge keys are a YAML 1.1 feature and may not be supported in YAML 1.2
44+55+# Test 1: Basic merge key
66+---
77+defaults: &defaults
88+ timeout: 30
99+ retries: 3
1010+ verbose: false
1111+1212+production:
1313+ <<: *defaults
1414+ environment: production
1515+# Expected: production should have timeout, retries, verbose from defaults, plus environment
1616+1717+# Test 2: Override after merge
1818+---
1919+base: &base
2020+ color: red
2121+ size: medium
2222+ weight: 100
2323+2424+custom:
2525+ <<: *base
2626+ color: blue
2727+ shape: circle
2828+# Expected: custom should have size and weight from base, but color should be blue, and add shape
2929+3030+# Test 3: Merging multiple anchors
3131+---
3232+connection: &connection
3333+ host: localhost
3434+ port: 8080
3535+3636+authentication: &auth
3737+ username: admin
3838+ password: secret
3939+4040+server:
4141+ <<: [*connection, *auth]
4242+ ssl: true
4343+# Expected: server should have host, port, username, password, and ssl
4444+4545+# Test 4: Multiple merges with override
4646+---
4747+defaults: &defaults
4848+ timeout: 30
4949+ retries: 3
5050+5151+advanced: &advanced
5252+ cache: true
5353+ pool_size: 10
5454+5555+config:
5656+ <<: [*defaults, *advanced]
5757+ timeout: 60
5858+ custom: value
5959+# Expected: config should have all fields from both anchors, with timeout overridden to 60
6060+6161+# Test 5: Nested merge
6262+---
6363+base_style: &base_style
6464+ font: Arial
6565+ size: 12
6666+6767+heading_defaults: &heading
6868+ <<: *base_style
6969+ weight: bold
7070+7171+main_heading:
7272+ <<: *heading
7373+ size: 18
7474+ color: navy
7575+# Expected: main_heading should inherit from heading (which inherits from base_style) with overrides
7676+7777+# Test 6: Merge in sequence context
7878+---
7979+common: &common
8080+ enabled: true
8181+ log_level: info
8282+8383+services:
8484+ - name: web
8585+ <<: *common
8686+ port: 80
8787+ - name: api
8888+ <<: *common
8989+ port: 3000
9090+ - name: worker
9191+ <<: *common
9292+ threads: 4
9393+# Expected: each service should have enabled and log_level, plus their specific fields
9494+9595+# Test 7: Empty merge (edge case)
9696+---
9797+empty: &empty {}
9898+9999+config:
100100+ <<: *empty
101101+ key: value
102102+# Expected: config should just have key: value
103103+104104+# Test 8: Merge with nested structures
105105+---
106106+metadata: &metadata
107107+ created: 2023-01-01
108108+ author: Admin
109109+ tags:
110110+ - v1
111111+ - stable
112112+113113+document:
114114+ <<: *metadata
115115+ title: Important Document
116116+ content: Some content here
117117+# Expected: document should have all metadata fields plus title and content
118118+119119+# Test 9: Chain of merges
120120+---
121121+level1: &l1
122122+ a: 1
123123+ b: 2
124124+125125+level2: &l2
126126+ <<: *l1
127127+ c: 3
128128+129129+level3:
130130+ <<: *l2
131131+ d: 4
132132+# Expected: level3 should have a, b, c, and d
133133+134134+# Test 10: Merge with conflicting keys
135135+---
136136+first: &first
137137+ name: First
138138+ value: 100
139139+ priority: low
140140+141141+second: &second
142142+ name: Second
143143+ value: 200
144144+ category: important
145145+146146+combined:
147147+ <<: [*first, *second]
148148+ name: Combined
149149+# Expected: later merges and direct assignments take precedence
150150+151151+# Test 11: Merge preserving types
152152+---
153153+numbers: &numbers
154154+ count: 42
155155+ ratio: 3.14
156156+ active: true
157157+158158+derived:
159159+ <<: *numbers
160160+ label: Test
161161+# Expected: types should be preserved (int, float, bool)
162162+163163+# Test 12: Complex real-world example
164164+---
165165+db_defaults: &db_defaults
166166+ pool_size: 5
167167+ timeout: 30
168168+ ssl: false
169169+170170+cache_defaults: &cache_defaults
171171+ ttl: 3600
172172+ max_size: 1000
173173+174174+development:
175175+ database:
176176+ <<: *db_defaults
177177+ host: localhost
178178+ name: dev_db
179179+ cache:
180180+ <<: *cache_defaults
181181+ backend: memory
182182+183183+production:
184184+ database:
185185+ <<: *db_defaults
186186+ host: prod.example.com
187187+ name: prod_db
188188+ ssl: true
189189+ pool_size: 20
190190+ cache:
191191+ <<: *cache_defaults
192192+ backend: redis
193193+ ttl: 7200
194194+# Expected: each environment should inherit defaults with environment-specific overrides
+126
yaml/ocaml-yamle/tests/yaml/collections_block.yml
···11+# Block Style Collections Test File
22+# Testing various block-style collection structures
33+44+# Simple sequence
55+simple_sequence:
66+ - apple
77+ - banana
88+ - cherry
99+ - date
1010+1111+# Simple mapping
1212+simple_mapping:
1313+ name: John Doe
1414+ age: 30
1515+ city: New York
1616+ country: USA
1717+1818+# Nested sequences
1919+nested_sequences:
2020+ - - alpha
2121+ - beta
2222+ - gamma
2323+ - - one
2424+ - two
2525+ - three
2626+ - - red
2727+ - green
2828+ - blue
2929+3030+# Nested mappings
3131+nested_mappings:
3232+ person:
3333+ name: Alice
3434+ contact:
3535+ email: alice@example.com
3636+ phone: 555-1234
3737+ address:
3838+ street: 123 Main St
3939+ city: Boston
4040+4141+# Mapping containing sequences
4242+mapping_with_sequences:
4343+ colors:
4444+ - red
4545+ - green
4646+ - blue
4747+ sizes:
4848+ - small
4949+ - medium
5050+ - large
5151+ numbers:
5252+ - 1
5353+ - 2
5454+ - 3
5555+5656+# Sequence containing mappings
5757+sequence_with_mappings:
5858+ - name: Alice
5959+ age: 25
6060+ role: developer
6161+ - name: Bob
6262+ age: 30
6363+ role: designer
6464+ - name: Charlie
6565+ age: 35
6666+ role: manager
6767+6868+# Deep nesting (4 levels)
6969+deep_nesting:
7070+ level1:
7171+ level2:
7272+ level3:
7373+ level4:
7474+ - deeply
7575+ - nested
7676+ - values
7777+ another_key: value
7878+ items:
7979+ - item1
8080+ - item2
8181+ metadata:
8282+ created: 2024-01-01
8383+ modified: 2024-12-04
8484+8585+# Mixed complex structure
8686+complex_structure:
8787+ database:
8888+ connections:
8989+ - host: db1.example.com
9090+ port: 5432
9191+ credentials:
9292+ username: admin
9393+ password: secret
9494+ - host: db2.example.com
9595+ port: 5432
9696+ credentials:
9797+ username: readonly
9898+ password: public
9999+ services:
100100+ - name: api
101101+ endpoints:
102102+ - /users
103103+ - /posts
104104+ - /comments
105105+ config:
106106+ timeout: 30
107107+ retries: 3
108108+ - name: worker
109109+ tasks:
110110+ - email
111111+ - reports
112112+ config:
113113+ concurrency: 10
114114+115115+# Empty sequences and mappings in block style
116116+empty_collections:
117117+ empty_sequence: []
118118+ empty_mapping: {}
119119+ sequence_with_empty:
120120+ - value1
121121+ - []
122122+ - value2
123123+ mapping_with_empty:
124124+ key1: value1
125125+ key2: {}
126126+ key3: value3
···11+# Full line comment at the beginning
22+# This is a YAML file testing comment handling
33+44+# Comment before a mapping
55+name: John Doe # End of line comment after a scalar value
66+age: 30 # Another end of line comment
77+88+# Comment between mapping entries
99+address:
1010+ # Comment inside nested mapping
1111+ street: 123 Main St # End of line comment in nested value
1212+ city: Springfield
1313+ # Comment between nested entries
1414+ zip: 12345
1515+1616+# Comment before sequence
1717+items:
1818+ - apple # Comment after sequence item
1919+ - banana
2020+ # Comment between sequence items
2121+ - cherry
2222+ - date # Last item comment
2323+2424+# Comment before flow sequence
2525+flow_seq: [1, 2, 3] # Comment after flow sequence
2626+2727+# Comment before flow mapping
2828+flow_map: {key1: value1, key2: value2} # Comment after flow mapping
2929+3030+# Comments with various indentation levels
3131+nested:
3232+ # Indented comment level 1
3333+ level1:
3434+ # Indented comment level 2
3535+ level2:
3636+ # Indented comment level 3
3737+ value: deeply nested # End comment at depth
3838+3939+# Multiple consecutive comments
4040+# Line 1
4141+# Line 2
4242+# Line 3
4343+multi_comment_key: value
4444+4545+# Comment with special characters: !@#$%^&*()
4646+special: "value with # hash inside quotes"
4747+4848+# Empty value with comment
4949+empty_value: # This key has no value (null)
5050+5151+# Comment before document end
5252+final_key: final_value
5353+# Final comment at end of file
···11+# Test 2: Three documents with different content types
22+---
33+# First document: mapping
44+name: John Doe
55+age: 30
66+city: New York
77+---
88+# Second document: sequence
99+- apple
1010+- banana
1111+- orange
1212+- grape
1313+---
1414+# Third document: scalar
1515+This is a plain scalar document
···11+# Test 4: With %YAML directive
22+%YAML 1.2
33+---
44+key1: value1
55+key2: value2
66+nested:
77+ inner: data
88+list:
99+ - item1
1010+ - item2
1111+ - item3
+155
yaml/ocaml-yamle/tests/yaml/edge_cases.yml
···11+# Edge cases test file for YAML parsing
22+33+# Case 1: Keys with colons (must be quoted)
44+"key:with:colons": value
55+"http://example.com": url_as_key
66+"time:12:30": time_value
77+88+# Case 2: Values starting with indicators (must be quoted or escaped)
99+indicator_square: "[this starts with bracket]"
1010+indicator_curly: "{this starts with brace}"
1111+indicator_star: "*this starts with star"
1212+indicator_amp: "&this starts with ampersand"
1313+indicator_question: "?this starts with question"
1414+indicator_pipe: "|this starts with pipe"
1515+indicator_gt: ">this starts with gt"
1616+indicator_dash: "-this starts with dash"
1717+indicator_hash: "#this starts with hash"
1818+1919+# Case 3: Special string values that look like other types
2020+string_true: "true"
2121+string_false: "false"
2222+string_null: "null"
2323+string_number: "123"
2424+string_float: "45.67"
2525+string_yes: "yes"
2626+string_no: "no"
2727+2828+# Case 4: Actual special values
2929+bool_true: true
3030+bool_false: false
3131+null_value: null
3232+null_tilde: ~
3333+number_int: 123
3434+number_float: 45.67
3535+number_exp: 1.23e4
3636+number_hex: 0x1F
3737+number_oct: 0o17
3838+3939+# Case 5: Empty values
4040+empty_string: ""
4141+empty_list: []
4242+empty_map: {}
4343+null_implicit:
4444+4545+# Case 6: Very long lines
4646+very_long_key: "This is a very long value that contains a lot of text to test how the parser handles long lines. It should be able to handle lines that are much longer than typical lines in most YAML files. This continues for quite a while to make sure we test the boundaries of reasonable line lengths. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
4747+4848+very_long_literal: |
4949+ This is a very long literal block that should preserve all the whitespace and newlines exactly as written. It can contain very long lines that go on and on and on without breaking. This tests whether the parser can handle long content in literal blocks properly. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
5050+5151+# Case 7: Unicode and special characters
5252+unicode_emoji: "Hello 🌍 World 🚀"
5353+unicode_chars: "Héllo Wörld 你好 مرحبا"
5454+unicode_key_🔑: unicode_value
5555+escaped_chars: "Line1\nLine2\tTabbed"
5656+5757+# Case 8: Nested empty structures
5858+nested_empty:
5959+ level1: {}
6060+ level2:
6161+ inner: []
6262+ level3:
6363+ inner:
6464+ deep: null
6565+6666+# Case 9: Complex keys (flow collections as keys)
6767+? [complex, key]
6868+: complex_value
6969+? {nested: key}
7070+: another_value
7171+7272+# Case 10: Multi-line keys and values
7373+? |
7474+ This is a multi-line
7575+ key using literal block
7676+: |
7777+ This is a multi-line
7878+ value using literal block
7979+8080+# Case 11: Quoted strings with escape sequences
8181+single_quoted: 'It''s a single-quoted string with doubled quotes'
8282+double_quoted: "It's a \"double-quoted\" string with escapes"
8383+backslash: "Path\\to\\file"
8484+newline_escape: "First line\nSecond line"
8585+8686+# Case 12: Anchors and aliases at edge positions
8787+anchor_list: &anchor_ref
8888+ - item1
8989+ - item2
9090+ - item3
9191+9292+alias_usage: *anchor_ref
9393+9494+nested_anchor:
9595+ data: &nested_ref
9696+ key: value
9797+ reference: *nested_ref
9898+9999+# Case 13: Mixed flow and block styles
100100+mixed_style:
101101+ block_key:
102102+ - flow_in_block: [1, 2, 3]
103103+ - another: {a: 1, b: 2}
104104+ flow_key: {block_in_flow:
105105+ - item1
106106+ - item2}
107107+108108+# Case 14: Trailing commas in flow (typically invalid in YAML)
109109+# flow_trailing: [1, 2, 3,] # This would be invalid
110110+111111+# Case 15: Strings that need quoting
112112+needs_quote_1: "value with # in it"
113113+needs_quote_2: "value with: colon"
114114+needs_quote_3: "value with @ at sign"
115115+needs_quote_4: "value with ` backtick"
116116+117117+# Case 16: Multiple documents separator (not starting a new document)
118118+not_doc_separator: "--- this is just a string value"
119119+120120+# Case 17: Extremely nested structures
121121+deeply_nested:
122122+ l1:
123123+ l2:
124124+ l3:
125125+ l4:
126126+ l5:
127127+ l6:
128128+ l7:
129129+ l8:
130130+ l9:
131131+ l10: "deep value"
132132+133133+# Case 18: Large sequence
134134+large_sequence:
135135+ - item_001
136136+ - item_002
137137+ - item_003
138138+ - item_004
139139+ - item_005
140140+ - item_006
141141+ - item_007
142142+ - item_008
143143+ - item_009
144144+ - item_010
145145+146146+# Case 19: Keys and values with only whitespace differences
147147+" key": "value with leading space in key"
148148+"key ": "value with trailing space in key"
149149+" spaced ": " spaced "
150150+151151+# Case 20: Binary-looking values
152152+binary_string: "0b101010"
153153+hex_string: "0xDEADBEEF"
154154+155155+# End of edge cases test file
+192
yaml/ocaml-yamle/tests/yaml/scalars_block.yml
···11+# Block scalars - literal and folded styles
22+---
33+# Literal style (|) - preserves newlines
44+literal_basic: |
55+ Line one
66+ Line two
77+ Line three
88+99+literal_with_indent: |
1010+ First line
1111+ Indented line
1212+ More indented
1313+ Back to second level
1414+ Back to first level
1515+1616+# Folded style (>) - converts newlines to spaces
1717+folded_basic: >
1818+ This is a long paragraph
1919+ that will be folded into
2020+ a single line with the
2121+ newlines converted to spaces.
2222+2323+folded_paragraph: >
2424+ First paragraph flows together
2525+ into a single line.
2626+2727+ Second paragraph after blank line
2828+ also flows together.
2929+3030+# Chomping indicators
3131+# Strip (-) - removes trailing newlines
3232+literal_strip: |-
3333+ No trailing newline
3434+3535+3636+literal_strip_multiple: |-
3737+ Text here
3838+3939+4040+folded_strip: >-
4141+ Folded text
4242+ with stripped
4343+ trailing newlines
4444+4545+4646+# Clip (default) - keeps single trailing newline
4747+literal_clip: |
4848+ One trailing newline
4949+5050+5151+literal_clip_explicit: |
5252+ This is the default behavior
5353+5454+5555+folded_clip: >
5656+ Folded with one
5757+ trailing newline
5858+5959+6060+# Keep (+) - preserves all trailing newlines
6161+literal_keep: |+
6262+ Keeps trailing newlines
6363+6464+6565+literal_keep_multiple: |+
6666+ Text here
6767+6868+6969+folded_keep: >+
7070+ Folded text
7171+ keeps trailing
7272+7373+7474+# Explicit indentation indicators
7575+literal_indent_2: |2
7676+ Two space indentation
7777+ is preserved here
7878+ Extra indent
7979+ Back to two
8080+8181+literal_indent_4: |4
8282+ Four space base indent
8383+ Second line
8484+ Extra indent
8585+ Back to base
8686+8787+folded_indent_2: >2
8888+ Text with two space
8989+ base indentation that
9090+ will be folded.
9191+9292+folded_indent_3: >3
9393+ Three space indent
9494+ for this folded
9595+ text block.
9696+9797+# Combinations of indicators
9898+literal_indent_strip: |2-
9999+ Indented by 2
100100+ No trailing newlines
101101+102102+103103+folded_indent_strip: >3-
104104+ Folded with indent
105105+ and stripped end
106106+107107+108108+literal_indent_keep: |2+
109109+ Indented by 2
110110+ Keeps trailing newlines
111111+112112+113113+folded_indent_keep: >4+
114114+ Folded indent 4
115115+ keeps all trailing
116116+117117+118118+# Empty block scalars
119119+empty_literal: |
120120+121121+empty_folded: >
122122+123123+# Block scalar with only newlines
124124+only_newlines_literal: |
125125+126126+127127+only_newlines_folded: >
128128+129129+130130+# Complex indentation patterns
131131+complex_literal: |
132132+ First level
133133+ Second level
134134+ Third level
135135+ Back to second
136136+ Back to first
137137+138138+ New paragraph
139139+ With indent
140140+141141+ Final paragraph
142142+143143+complex_folded: >
144144+ This paragraph
145145+ flows together.
146146+147147+ This is separate.
148148+ This line starts more indented
149149+ and continues.
150150+151151+ Final thoughts here.
152152+153153+# Special characters in block scalars
154154+special_chars_literal: |
155155+ Special: @#$%^&*()
156156+ Quotes: "double" 'single'
157157+ Brackets: [array] {object}
158158+ Symbols: | > & * ? : -
159159+160160+special_chars_folded: >
161161+ All special chars are literal
162162+ in block scalars: []{}|>*&
163163+164164+# Block scalars in sequences
165165+sequence_with_blocks:
166166+ - |
167167+ First item
168168+ literal block
169169+ - >
170170+ Second item
171171+ folded block
172172+ - |-
173173+ Third item
174174+ stripped
175175+ - |+
176176+ Fourth item
177177+ kept
178178+179179+180180+# Block scalars in nested mappings
181181+nested:
182182+ description: >
183183+ This is a folded
184184+ description that spans
185185+ multiple lines.
186186+ code: |
187187+ def hello():
188188+ print("Hello, World!")
189189+ return True
190190+ notes: |-
191191+ Final notes
192192+ with stripped end
+60
yaml/ocaml-yamle/tests/yaml/scalars_plain.yml
···11+# Plain scalars - no quotes needed
22+---
33+# Simple words
44+simple_word: hello
55+single_character: x
66+number_like: 123
77+boolean_like: true
88+null_like: null
99+1010+# Multi-word values (no special meaning characters)
1111+sentence: this is a plain scalar
1212+phrase: plain scalars can have spaces
1313+1414+# Numbers and special values that remain strings in context
1515+age: 42
1616+pi: 3.14159
1717+negative: -273
1818+scientific: 1.23e-4
1919+hex_like: 0x1A2B
2020+octal_like: 0o755
2121+2222+# Special characters that are valid in plain scalars
2323+with_colon: "value: with colon needs quotes in value"
2424+with_comma: "commas, need quotes in flow context"
2525+with_hash: "# needs quotes if starting with hash"
2626+hyphen_start: "- needs quotes if starting like list"
2727+question_start: "? needs quotes if starting like mapping key"
2828+2929+# Plain scalars with valid special characters
3030+email: user@example.com
3131+url: http://example.com/path
3232+path: /usr/local/bin
3333+ratio: 16:9
3434+version: v1.2.3
3535+3636+# Multi-line plain scalars (line folding)
3737+# Newlines become spaces, blank lines become newlines
3838+folded_plain: This is a long
3939+ plain scalar that spans
4040+ multiple lines and will
4141+ be folded into a single line
4242+ with spaces.
4343+4444+another_folded: First paragraph
4545+ continues here and here.
4646+4747+ Second paragraph after blank line.
4848+ Also continues.
4949+5050+# Trailing and leading spaces are trimmed in plain scalars
5151+spaces_trimmed: value with spaces
5252+5353+# Plain scalars can contain most punctuation
5454+punctuation: Hello, world! How are you? I'm fine.
5555+symbols: $100 & 50% off @ store #1
5656+math: 2+2=4 and 3*3=9
5757+5858+# Empty plain scalar (becomes null)
5959+empty_implicit:
6060+explicit_empty: ""
+81
yaml/ocaml-yamle/tests/yaml/scalars_quoted.yml
···11+# Quoted scalars - single and double quoted strings
22+---
33+# Single-quoted strings
44+single_simple: 'hello world'
55+single_with_double: 'He said "hello"'
66+single_escaped_quote: 'It''s a single quote: ''example'''
77+single_multiline: 'This is a
88+ multi-line single
99+ quoted string'
1010+1111+# Double-quoted strings
1212+double_simple: "hello world"
1313+double_with_single: "It's easy"
1414+double_escaped_quote: "She said \"hello\""
1515+1616+# Escape sequences in double-quoted strings
1717+escaped_newline: "Line one\nLine two\nLine three"
1818+escaped_tab: "Column1\tColumn2\tColumn3"
1919+escaped_backslash: "Path: C:\\Users\\Name"
2020+escaped_carriage: "Before\rAfter"
2121+escaped_bell: "Bell\a"
2222+escaped_backspace: "Back\b"
2323+escaped_formfeed: "Form\f"
2424+escaped_vertical: "Vertical\vtab"
2525+2626+# Unicode escapes
2727+unicode_16bit: "Snowman: \u2603"
2828+unicode_32bit: "Emoji: \U0001F600"
2929+unicode_hex: "Null byte: \x00"
3030+3131+# Empty strings
3232+empty_single: ''
3333+empty_double: ""
3434+3535+# Strings that would be interpreted as other types if unquoted
3636+string_true: "true"
3737+string_false: "false"
3838+string_null: "null"
3939+string_number: "123"
4040+string_float: "45.67"
4141+string_octal: "0o755"
4242+string_hex: "0xFF"
4343+4444+# Special YAML characters that need quoting
4545+starts_with_at: "@username"
4646+starts_with_backtick: "`command`"
4747+starts_with_ampersand: "&reference"
4848+starts_with_asterisk: "*alias"
4949+starts_with_exclamation: "!tag"
5050+starts_with_pipe: "|literal"
5151+starts_with_gt: ">folded"
5252+starts_with_percent: "%directive"
5353+5454+# Flow indicators that need quoting
5555+with_brackets: "[not a list]"
5656+with_braces: "{not: a map}"
5757+with_comma: "a, b, c"
5858+with_colon_space: "key: value"
5959+6060+# Quoted strings preserve leading/trailing whitespace
6161+leading_space: " spaces before"
6262+trailing_space: "spaces after "
6363+both_spaces: " spaces both "
6464+6565+# Multi-line quoted strings
6666+double_multiline: "This is a string
6767+ that spans multiple
6868+ lines with escaped newlines."
6969+7070+single_fold: 'This single quoted
7171+ string will fold
7272+ lines into spaces.'
7373+7474+# Complex escape sequences
7575+complex_escapes: "Tab:\t Newline:\n Quote:\" Backslash:\\ Unicode:\u0041"
7676+7777+# Edge cases
7878+only_spaces_single: ' '
7979+only_spaces_double: " "
8080+only_newlines: "\n\n\n"
8181+mixed_quotes: "She said 'it''s a beautiful day'"
+82
yaml/ocaml-yamle/tests/yaml/values_bool.yml
···11+# Boolean value test cases for YAML 1.2
22+# Note: YAML 1.2 only recognizes 'true' and 'false' as booleans
33+# Other values like yes/no, on/off are treated as strings in 1.2
44+55+# Standard YAML 1.2 booleans (lowercase)
66+bool_true: true
77+bool_false: false
88+99+# Capitalized forms (should be strings in YAML 1.2)
1010+capitalized_true: True
1111+capitalized_false: False
1212+1313+# YAML 1.1 style booleans (should be strings in YAML 1.2)
1414+yes_value: yes
1515+no_value: no
1616+Yes_value: Yes
1717+No_value: No
1818+YES_value: YES
1919+NO_value: NO
2020+2121+# On/Off style (should be strings in YAML 1.2)
2222+on_value: on
2323+off_value: off
2424+On_value: On
2525+Off_value: Off
2626+ON_value: ON
2727+OFF_value: OFF
2828+2929+# Booleans in sequences
3030+bool_sequence:
3131+ - true
3232+ - false
3333+ - yes
3434+ - no
3535+ - on
3636+ - off
3737+3838+# Booleans in flow style
3939+flow_bools: [true, false, yes, no]
4040+4141+# Booleans in mappings
4242+bool_mapping:
4343+ active: true
4444+ disabled: false
4545+ enabled: yes
4646+ stopped: no
4747+4848+# String literals that should NOT be parsed as booleans
4949+quoted_bools:
5050+ quoted_true: "true"
5151+ quoted_false: "false"
5252+ quoted_yes: "yes"
5353+ quoted_no: "no"
5454+ single_true: 'true'
5555+ single_false: 'false'
5656+5757+# Nested boolean values
5858+nested_bools:
5959+ settings:
6060+ debug: true
6161+ verbose: false
6262+ legacy_yes: yes
6363+ legacy_no: no
6464+ flags:
6565+ - true
6666+ - false
6767+ - on
6868+ - off
6969+7070+# Mixed case variations
7171+mixed_case:
7272+ TRUE: TRUE
7373+ FALSE: FALSE
7474+ TrUe: TrUe
7575+ FaLsE: FaLsE
7676+7777+# Boolean-like strings that should remain strings
7878+bool_like_strings:
7979+ truthy: truely
8080+ falsy: falsetto
8181+ yes_sir: yessir
8282+ no_way: noway
+55
yaml/ocaml-yamle/tests/yaml/values_null.yml
···11+# Null value test cases for YAML 1.2
22+33+# Explicit null keyword
44+explicit_null: null
55+66+# Tilde shorthand for null
77+tilde_null: ~
88+99+# Empty value (implicit null)
1010+empty_null:
1111+1212+# Null in flow style
1313+flow_null: [null, ~, ]
1414+1515+# Null in sequences
1616+sequence_nulls:
1717+ - null
1818+ - ~
1919+ -
2020+ - explicit: null
2121+ - tilde: ~
2222+ - empty:
2323+2424+# Null in mappings
2525+mapping_nulls:
2626+ key1: null
2727+ key2: ~
2828+ key3:
2929+3030+# Null as key
3131+null: "null key with string value"
3232+~: "tilde key with string value"
3333+3434+# Mixed null values in nested structures
3535+nested:
3636+ level1:
3737+ null_value: null
3838+ tilde_value: ~
3939+ empty_value:
4040+ list:
4141+ - null
4242+ - ~
4343+ -
4444+ - some_value
4545+ map:
4646+ a: null
4747+ b: ~
4848+ c:
4949+5050+# String literals that contain "null" (should NOT be parsed as null)
5151+string_nulls:
5252+ quoted_null: "null"
5353+ quoted_tilde: "~"
5454+ null_in_string: "this is null"
5555+ word_null: 'null'