Skip to content

Commit

Permalink
test root-level indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Jun 20, 2023
1 parent 5bfde65 commit b23181a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/run_jsonlab_test.m
Expand Up @@ -57,8 +57,8 @@ function run_jsonlab_test(tests)
test_jsonlab('empty name',@savejson,loadjson('{"":""}'),'{"":""}','compact',1);
if(exist('containers.Map'))
test_jsonlab('empty name with map',@savejson,loadjson('{"":""}','usemap',1),'{"":""}','compact',1);
test_jsonlab('indentation',@savejson,savejson(containers.Map({'a','b'},{[],struct('c',1.1,'d',struct('e',{1,2}))})),...
'"{\n\t\"a\":[],\n\t\"b\":{\n\t\t\"c\":1.1,\n\t\t\"d\":[\n\t\t\t{\n\t\t\t\t\"e\":1\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"e\":2\n\t\t\t}\n\t\t]\n\t}\n}\n"');
test_jsonlab('indentation',@savejson,savejson('s',containers.Map({'a','b'},{[],struct('c',1.1,'d',struct('e',{1,2}))})),...
'"{\n\t\"s\":{\n\t\t\"a\":[],\n\t\t\"b\":{\n\t\t\t\"c\":1.1,\n\t\t\t\"d\":[\n\t\t\t\t{\n\t\t\t\t\t\"e\":1\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"e\":2\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t}\n}\n"');
end
test_jsonlab('row vector',@savejson,[1,2,3],'[1,2,3]');
test_jsonlab('column vector',@savejson,[1;2;3],'[[1],[2],[3]]','compact',1);
Expand Down

0 comments on commit b23181a

Please sign in to comment.