ion-tests
ion-tests copied to clipboard
Add bad tests for -0 integers
Initially mentioned in https://github.com/amzn/ion-tests/pull/57#discussion_r362974284.
Value zero with type code 3 is illegal no matter how it's encoded.
It would be good to add bad tests for
E0 01 00 EA 31 00
E0 01 00 EA 32 00
...
E0 01 00 EA 3E 81 00
Per the binary specification every representation of 0 other than 0x20
is invalid.
If the value is zero then T must be 2, L is zero, and there are no length or magnitude subfields.
Resolving this issue should likely include adding bad tests for invalid positive representations of 0 as well.
E0 01 00 EA 21 00
...
We need to clarify the spec. Overpadded zero values on type code 2 (e.g. 21 00) should be allowed. I've created https://github.com/amzn/ion-docs/issues/93.