diff --git a/README.md b/README.md index 5da06f7..398b1c9 100644 --- a/README.md +++ b/README.md @@ -195,6 +195,19 @@ 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 +-------------------------------- +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. + +- Millisecond precision (4 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). + + This tests only millisecond precision, and not any further precision or the + truncation of it. + + Assumptions of Truth -------------------- The following are taken as ground truths by `toml-test`: diff --git a/tests/valid/datetime/milliseconds.json b/tests/valid/datetime/milliseconds.json index bb896af..c49e400 100644 --- a/tests/valid/datetime/milliseconds.json +++ b/tests/valid/datetime/milliseconds.json @@ -1,18 +1,18 @@ { "utc1": { "type": "datetime", - "value": "1987-07-05T17:45:56.123456Z" + "value": "1987-07-05T17:45:56.1234Z" }, "utc2": { "type": "datetime", - "value": "1987-07-05T17:45:56.600000Z" + "value": "1987-07-05T17:45:56.6000Z" }, "wita1": { "type": "datetime", - "value": "1987-07-05T17:45:56.123456+08:00" + "value": "1987-07-05T17:45:56.1234+08:00" }, "wita2": { "type": "datetime", - "value": "1987-07-05T17:45:56.600000+08:00" + "value": "1987-07-05T17:45:56.6000+08:00" } } diff --git a/tests/valid/datetime/milliseconds.toml b/tests/valid/datetime/milliseconds.toml index a6c0590..24b81f8 100644 --- a/tests/valid/datetime/milliseconds.toml +++ b/tests/valid/datetime/milliseconds.toml @@ -1,4 +1,4 @@ -utc1 = 1987-07-05T17:45:56.123456Z +utc1 = 1987-07-05T17:45:56.1234Z utc2 = 1987-07-05T17:45:56.6Z -wita1 = 1987-07-05T17:45:56.123456+08:00 +wita1 = 1987-07-05T17:45:56.1234+08:00 wita2 = 1987-07-05T17:45:56.6+08:00