mirror of https://github.com/Hax-io/jstruct
parent
b66c7741af
commit
c0bd2d624e
|
@ -280,15 +280,18 @@ unittest
|
|||
|
||||
}
|
||||
|
||||
version(unittest)
|
||||
{
|
||||
import std.string : cmp;
|
||||
import std.stdio : writeln;
|
||||
}
|
||||
|
||||
/**
|
||||
* Another example deserialization of JSON
|
||||
* to our `Person` struct
|
||||
*/
|
||||
unittest
|
||||
{
|
||||
import std.string : cmp;
|
||||
import std.stdio : writeln;
|
||||
|
||||
struct Person
|
||||
{
|
||||
public string firstname, lastname;
|
||||
|
@ -347,7 +350,6 @@ unittest
|
|||
try
|
||||
{
|
||||
Person person = fromJSON!(Person)(json);
|
||||
import std.stdio : writeln;
|
||||
writeln(person);
|
||||
assert(true);
|
||||
}
|
||||
|
|
|
@ -87,16 +87,19 @@ private enum EnumType
|
|||
CAT
|
||||
}
|
||||
|
||||
version(unittest)
|
||||
{
|
||||
import std.algorithm.searching : canFind;
|
||||
import std.string : cmp;
|
||||
import std.stdio : writeln;
|
||||
}
|
||||
|
||||
/**
|
||||
* Example serialization of our struct
|
||||
* `Person` to JSON
|
||||
*/
|
||||
unittest
|
||||
{
|
||||
import std.algorithm.searching : canFind;
|
||||
import std.string : cmp;
|
||||
import std.stdio : writeln;
|
||||
|
||||
struct Person
|
||||
{
|
||||
public string firstname, lastname;
|
||||
|
|
Loading…
Reference in New Issue