aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorMike Buland <mbuland@penny-arcade.com>2017-06-06 23:57:26 -0700
committerMike Buland <mbuland@penny-arcade.com>2017-06-06 23:57:26 -0700
commite98644cd777ddd4ae769da2d8bdcbc6fa8bbb30a (patch)
treefef43ac703e4d3de7a28c86e0b7e2e77988b2a78 /src/test
parentdc759b40b9a18b20454b68244dd063ab56155c3e (diff)
downloadlibbu++-e98644cd777ddd4ae769da2d8bdcbc6fa8bbb30a.tar.gz
libbu++-e98644cd777ddd4ae769da2d8bdcbc6fa8bbb30a.tar.bz2
libbu++-e98644cd777ddd4ae769da2d8bdcbc6fa8bbb30a.tar.xz
libbu++-e98644cd777ddd4ae769da2d8bdcbc6fa8bbb30a.zip
Updated .gitignore, included terrible json test.
Diffstat (limited to '')
-rw-r--r--src/tests/json.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/tests/json.cpp b/src/tests/json.cpp
new file mode 100644
index 0000000..7c1c119
--- /dev/null
+++ b/src/tests/json.cpp
@@ -0,0 +1,22 @@
1#include <bu/json.h>
2#include <bu/file.h>
3#include <bu/sio.h>
4#include <bu/streamstack.h>
5
6int main( int argc, char *argv[] )
7{
8 Bu::File fIn( "test1.json", Bu::File::Read );
9 Bu::Json ob( fIn );
10 ob.write( Bu::sioRaw );
11 Bu::println("\n");
12 Bu::String back1 = ob.toStringStable();
13 Bu::Json ob2( back1 );
14 Bu::String back2 = ob2.toStringStable();
15 Bu::println( back1 );
16 Bu::println( back2 );
17 if( back1 == back2 )
18 Bu::println("loop success");
19 else
20 Bu::println("loop failure");
21}
22