From 5a8759254d8dfb68bc790bb7b6f4438bb03f6dcd Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Sat, 30 Sep 2023 00:36:22 +0100 Subject: [PATCH] Add a note that encoder tests only test semantic equality Closes #85 --- README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 616b73e..a26bb35 100644 --- a/README.md +++ b/README.md @@ -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).