Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/encoding/yaml: add test cases for YAML 1.1 and 1.2 octals
YAML 1.1 has octal numbers with the "0" prefix, whereas YAML 1.2 has octal numbers with the "0o" prefix. Both are used in the wild, so we must be able to handle both. Right now, a non-octal number beginning with "0" results in an error, whereas most YAML decoders, including go-yaml's Unmarshal, fall back to decoding the value as a string. We will implement a fix like that in a follow-up commit; this commit simply adds test cases to show the current behavior. Also add cases where YAML 1.1 and 1.2 octal integer literals are prefixed with an explicit !!float tag, where the user definitely does not mean the input to be an octal integer. We don't want any change in our handling of octal integers to change these cases, even if one of the cases is broken per the added TODO. For #2578. Signed-off-by: Daniel Martí <mvdan@mvdan.cc> Change-Id: I46f54f43d7f47c83ec907e421a37b049ad9d3137 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1195046 TryBot-Result: CUEcueckoo <cueckoo@cuelang.org> Reviewed-by: Roger Peppe <rogpeppe@gmail.com> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
- Loading branch information