add compound object test
This commit is contained in:
parent
9e01e3a704
commit
cea0cb55c7
1 changed files with 40 additions and 1 deletions
|
@ -22,7 +22,8 @@ test_cases() ->
|
||||||
++ strings()
|
++ strings()
|
||||||
++ literals()
|
++ literals()
|
||||||
++ integers()
|
++ integers()
|
||||||
++ floats().
|
++ floats()
|
||||||
|
++ compound_object().
|
||||||
|
|
||||||
|
|
||||||
empty_array() -> [{"[]", <<"[]">>, [], [start_array, end_array]}].
|
empty_array() -> [{"[]", <<"[]">>, [], [start_array, end_array]}].
|
||||||
|
@ -149,6 +150,44 @@ literals() ->
|
||||||
++ [ wrap_with_object(Test) || Test <- naked_literals() ].
|
++ [ wrap_with_object(Test) || Test <- naked_literals() ].
|
||||||
|
|
||||||
|
|
||||||
|
compound_object() ->
|
||||||
|
[{
|
||||||
|
"[{\"alpha\":[1,2,3],\"beta\":{\"alpha\":[1.0,2.0,3.0],\"beta\":[true,false]}},[{}]]",
|
||||||
|
<<"[{\"alpha\":[1,2,3],\"beta\":{\"alpha\":[1.0,2.0,3.0],\"beta\":[true,false]}},[{}]]">>,
|
||||||
|
[[{<<"alpha">>, [1, 2, 3]}, {<<"beta">>, [{<<"alpha">>, [1.0, 2.0, 3.0]}, {<<"beta">>, [true, false]}]}], [[{}]]],
|
||||||
|
[
|
||||||
|
start_array,
|
||||||
|
start_object,
|
||||||
|
{key, <<"alpha">>},
|
||||||
|
start_array,
|
||||||
|
{integer, 1},
|
||||||
|
{integer, 2},
|
||||||
|
{integer, 3},
|
||||||
|
end_array,
|
||||||
|
{key, <<"beta">>},
|
||||||
|
start_object,
|
||||||
|
{key, <<"alpha">>},
|
||||||
|
start_array,
|
||||||
|
{float, 1.0},
|
||||||
|
{float, 2.0},
|
||||||
|
{float, 3.0},
|
||||||
|
end_array,
|
||||||
|
{key, <<"beta">>},
|
||||||
|
start_array,
|
||||||
|
{literal, true},
|
||||||
|
{literal, false},
|
||||||
|
end_array,
|
||||||
|
end_object,
|
||||||
|
end_object,
|
||||||
|
start_array,
|
||||||
|
start_object,
|
||||||
|
end_object,
|
||||||
|
end_array,
|
||||||
|
end_array
|
||||||
|
]
|
||||||
|
}].
|
||||||
|
|
||||||
|
|
||||||
wrap_with_array({Title, JSON, Term, Events}) ->
|
wrap_with_array({Title, JSON, Term, Events}) ->
|
||||||
{
|
{
|
||||||
"[" ++ Title ++ "]",
|
"[" ++ Title ++ "]",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue