Skip to content

Commit

Permalink
Add a note that encoder tests only test semantic equality
Browse files Browse the repository at this point in the history
Closes #85
  • Loading branch information
arp242 committed Sep 29, 2023
1 parent 2eba28c commit 5a87592
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,21 @@ An example implementation can be found in the BurnSushi/toml:
- [Add tags](https://github.com/BurntSushi/toml/blob/master/internal/tag/add.go)
- [Remove tags](https://github.com/BurntSushi/toml/blob/master/internal/tag/rm.go)

Implementation-defined behaviour
--------------------------------
Untested and implementation-defined behaviour
---------------------------------------------
This only tests behaviour that's should be true for every encoder implementing
TOML; a few things are left up to implementations, and are not tested here.

- Many values can be expressed in more than one way: for example `0xff` and
`255` are equal, as are `0.0` and `-0.0`.

Some encoders may choose to always write back in a certain format (e.g.
decimal), others may choose to use the same as the input format.

Testing how exactly a value is written in encoder tests is left up to the
implementation, as long as they're semantically identical the test is
considered to pass.

- Millisecond precision (3 digits) is required for datetimes and times, and
further precision is implementation-specific, and any greater precision than
is supported must be truncated (not rounded).
Expand Down

0 comments on commit 5a87592

Please sign in to comment.