diff options
Diffstat (limited to '')
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | src/tests/json.cpp | 22 |
2 files changed, 26 insertions, 0 deletions
@@ -11,8 +11,12 @@ | |||
11 | /myriad | 11 | /myriad |
12 | /viewcsv | 12 | /viewcsv |
13 | .*.swp | 13 | .*.swp |
14 | .*.un~ | ||
14 | /src/autoconfig.h | 15 | /src/autoconfig.h |
15 | /src/signals.h | 16 | /src/signals.h |
16 | /src/version.h | 17 | /src/version.h |
17 | /bu | 18 | /bu |
18 | /.build_cache | 19 | /.build_cache |
20 | /unit | ||
21 | /tests | ||
22 | /src/unit/*.cpp | ||
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 | |||
6 | int 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 | |||