| # 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): |
| ./in.cue:3:5 |
| ./in.cue:3:41 |
| yaml.Validate:3:5 |
| b: error in call to encoding/yaml.Validate: incomplete value int: |
| ./in.cue:5:5 |
| a: error in call to encoding/yaml.ValidatePartial: invalid value 4 (out of bound <3): |
| ./in.cue:6:5 |
| ./in.cue:6:48 |
| yaml.ValidatePartial:3:5 |
| |
| Result: |
| t1: _|_ // error in call to encoding/yaml.Validate: a: invalid value 4 (out of bound <3) |
| t2: true |
| t3: _|_ // error in call to encoding/yaml.Validate: b: incomplete value int |
| t4: _|_ // error in call to encoding/yaml.ValidatePartial: a: invalid value 4 (out of bound <3) |
| t5: true |
| t6: true |
| t7: """ |
| a: 1 |
| --- |
| b: 2 |
| |
| """ |
| t8: """ |
| b: 2 |
| |
| """ |
| t9: """ |
| a: 1 |
| --- |
| b: 2 |
| |
| """ |
| |