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

int main( int argc, char *argv[] )
{
    Bu::Json j( "\x01" "ACTION" "\x01" );
    Bu::println( j.toString() );
    return 0;
}

void hi()
{
    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");
}