Mirror of https://github.com/cue-lang/cue cuelang.org
cue go

internal/encoding/yaml: copy decode_test.go from internal/third_party/yaml master

These test files and test cases were originally inherited from go-yaml when Marcel started the fork in internal/third_party/yaml in late 2018. Many of these tests, particularly unmarshalTests, have been modified and extended over time to cover fixes made to the decoder in the fork. As we transition away from maintaining a fork of go-yaml, we don't want to lose any of these test cases, especially to ensure that we don't re-introduce any bugs fixed in the last five years. Copy the files to internal/encoding/yaml, where we will house the new YAML decoder for the time being. Note that the test files still test against internal/third_party/yaml; we will move them over to internal/encoding/yaml once the new decoder lands. There are some bits of decode_test.go that we omit from the copy, as they are not useful to us: * Commented out code from upstream, such as TestUnmarshalFullTimestamp and BenchmarkUnmarshal. * TestFuzzCrashers, unmodified from upstream, and which is really fuzzing the token scanning code in go-yaml, and not our code. * Unused test case types. Signed-off-by: Daniel Martí <mvdan@mvdan.cc> Change-Id: Icb5805d0dd8d3de6afc20e37934046bf67bb7f0b Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1191228 Reviewed-by: Roger Peppe <rogpeppe@gmail.com> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>


+1064
3 changed files