Unit tests

- Document all
This commit is contained in:
Tristan B. Velloza Kildaire 2023-06-23 09:17:29 +02:00
parent 13fe2e1332
commit eb35dd4b13
2 changed files with 13 additions and 0 deletions

View File

@ -194,6 +194,10 @@ public RecordType fromJSON(RecordType)(JSONValue jsonIn)
return record;
}
/**
* Example deserialization of JSON
* to our `Person` struct
*/
unittest
{
import std.string : cmp;
@ -242,6 +246,10 @@ unittest
assert(person.list4 == [1.5, 1.4]);
}
/**
* Another example deserialization of JSON
* to our `Person` struct
*/
unittest
{
import std.string : cmp;

View File

@ -90,6 +90,11 @@ private enum EnumType
DOG,
CAT
}
/**
* Example serialization of our struct
* `Person` to JSON
*/
unittest
{
import std.algorithm.searching : canFind;