! exec cue vet schema.cue data.yaml
cmp stderr yaml-stderr

! exec cue export schema.cue data.yaml
cmp stderr yaml-stderr

# Ensure this also works for other encodings.

! exec cue vet schema.cue data.toml
cmp stderr toml-stderr

-- schema.cue --
#Language: {
	tag:  string
	name: =~"^\\p{Lu}" // Must start with an uppercase letter.
}
languages: [...#Language]

-- data.yaml --
languages:
  - tag: en
    name: English
  - tag: nl
    name: dutch
  - tag: no
    name: Norwegian
-- data.toml --
[[languages]]
name = 'English'
tag = 'en'
[[languages]]
name = 'dutch'
tag = 'nl'
[[languages]]
name = 'Norwegian'
tag = 'no'
-- yaml-stderr --
languages.1.name: invalid value "dutch" (out of bound =~"^\\p{Lu}"):
    ./schema.cue:3:8
    ./data.yaml:5:11
-- toml-stderr --
languages.1.name: invalid value "dutch" (out of bound =~"^\\p{Lu}"):
    ./schema.cue:3:8
    ./data.toml:5:8
