blob: 034ef27e46d5c2127912e74b8f02361c6d9b02ab [file] [log] [blame]
# generated from the original tests.
# Henceforth it may be nicer to group tests into separate files.
-- in.cue --
import "encoding/yaml"
t1: yaml.Validate("a: 2\n---\na: 4", {a:<3})
t2: yaml.Validate("a: 2\n---\na: 4", {a:<5})
t3: yaml.Validate("a: 2\n", {a:<5, b:int})
t4: yaml.ValidatePartial("a: 2\n---\na: 4", {a:<3})
t5: yaml.ValidatePartial("a: 2\n---\na: 4", {a:<5})
t6: yaml.ValidatePartial("a: 2\n", {a:<5, b:int})
t7: yaml.MarshalStream([{a: 1}, {b: 2}])
t8: yaml.Marshal({b: int | *2})
t9: yaml.MarshalStream([{a: 1}, {b: int | *2}])
-- out/yaml --
Errors:
a: error in call to encoding/yaml.Validate: invalid value 4 (out of bound <3)
a: error in call to encoding/yaml.ValidatePartial: invalid value 4 (out of bound <3)
b: error in call to encoding/yaml.Validate: incomplete value int
Result:
t1: _|_ // error in call to encoding/yaml.Validate: a: invalid value 4 (out of bound <3) (and 1 more errors)
t2: true
t3: _|_ // error in call to encoding/yaml.Validate: b: incomplete value int (and 1 more errors)
t4: _|_ // error in call to encoding/yaml.ValidatePartial: a: invalid value 4 (out of bound <3) (and 1 more errors)
t5: true
t6: true
t7: """
a: 1
---
b: 2
"""
t8: """
b: 2
"""
t9: """
a: 1
---
b: 2
"""