diff options
author | Mike Buland <mbuland@penny-arcade.com> | 2017-06-06 23:57:26 -0700 |
---|---|---|
committer | Mike Buland <mbuland@penny-arcade.com> | 2017-06-06 23:57:26 -0700 |
commit | e98644cd777ddd4ae769da2d8bdcbc6fa8bbb30a (patch) | |
tree | fef43ac703e4d3de7a28c86e0b7e2e77988b2a78 | |
parent | dc759b40b9a18b20454b68244dd063ab56155c3e (diff) | |
download | libbu++-e98644cd777ddd4ae769da2d8bdcbc6fa8bbb30a.tar.gz libbu++-e98644cd777ddd4ae769da2d8bdcbc6fa8bbb30a.tar.bz2 libbu++-e98644cd777ddd4ae769da2d8bdcbc6fa8bbb30a.tar.xz libbu++-e98644cd777ddd4ae769da2d8bdcbc6fa8bbb30a.zip |
Updated .gitignore, included terrible json test.
-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 | |||