aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/json/flex_buffers/ut/cvt_ut.cpp
blob: de3eb0d520b7483846b917fda6ac0f6444ed9c52 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <library/cpp/testing/unittest/registar.h>
#include <library/cpp/json/flex_buffers/cvt.h>
 
using namespace NJson; 
 
static auto JSON = R"({ 
    "a": { 
        "b": [1, 2, 3], 
        "c": ["x", "y", 3, "z"] 
    } 
})"; 
 
static auto RES = R"({ a: { b: [ 1, 2, 3 ], c: [ "x", "y", 3, "z" ] } })"; 
 
Y_UNIT_TEST_SUITE(JsonToFlex) { 
    Y_UNIT_TEST(Test1) { 
        auto buf = ConvertJsonToFlexBuffers(JSON); 
 
        UNIT_ASSERT_VALUES_EQUAL(FlexToString(buf), RES); 
    } 
}