aboutsummaryrefslogtreecommitdiff
path: root/src/tests/json.cpp
blob: 7c1c119cd589ce79285fcda6f8167e8a6ffc6e39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <bu/json.h>
#include <bu/file.h>
#include <bu/sio.h>
#include <bu/streamstack.h>

int main( int argc, char *argv[] )
{
    Bu::File fIn( "test1.json", Bu::File::Read );
    Bu::Json ob( fIn );
    ob.write( Bu::sioRaw );
    Bu::println("\n");
    Bu::String back1 = ob.toStringStable();
    Bu::Json ob2( back1 );
    Bu::String back2 = ob2.toStringStable();
    Bu::println( back1 );
    Bu::println( back2 );
    if( back1 == back2 )
        Bu::println("loop success");
    else
        Bu::println("loop failure");
}