simdjson / experimental_json_builder

Experimental JSON builder based on C++ reflection
Apache License 2.0
46 stars 2 forks source link

add unit tests #9

Open lemire opened 6 months ago

lemire commented 6 months ago

I am not 100% sure how to test a serializer... if we don't have deserialization... but we need to think about unit tests.

Yaraslaut commented 6 months ago

Here is an example how one can check serialization inside shell:

a.out > file
grep "Z{X{B{.m0=0}, .m1=1}, Y{B{.m0=0}, .m2=2}, .m3=3, .m4=4}" file | wc -l

and llvm uses lit to run such tests for example https://github.com/bloomberg/clang-p2996/blob/c2764acc619ae358a42aa8d8fddd4bef7788aad6/libcxx/test/std/experimental/reflection/p2996-ex-universal-formatter.sh.cpp#L89