@@ -265,7 +265,7 @@ function run_jsonlab_test(tests)
265265 test_jsonlab(' heterogeneous cell' , @savebj , {{1 , {2 , 3 }}, {4 , 5 }, {6 }; {7 }, {8 , 9 }, {10 }}, ...
266266 ' [[[U<1>[U<2>U<3>]][U<4>U<5>][U<6>]][[U<7>][U<8>U<9>][U<10>]]]' , ' debug' , 1 );
267267 test_jsonlab(' struct array' , @savebj , repmat(struct(' i' , 1.1 , ' d' , ' str' ), [1 , 2 ]), ...
268- ' [{U<1>iD<1.1>U<1>dSU<3>str}{U<1>iD<1.1>U<1>dSU<3>str}]' , ' debug' , 1 );
268+ ' [{U<1>iD<1.1>U<1>dSU<3>str}{U<1>iD<1.1>U<1>dSU<3>str}]' , ' debug' , 1 , ' formatversion ' , 2 );
269269 test_jsonlab(' encoded fieldnames' , @savebj , struct(encodevarname(' _i' ), 1 , encodevarname(' i_' ), ' str' ), ...
270270 ' {U<2>_iU<1>U<2>i_SU<3>str}' , ' debug' , 1 );
271271 test_jsonlab(' optimized 2D row-major array' , @savebj , loadbj([' [$i#[$U#U' char([2 2 3 61 62 65 66 67 68 ])]), ' [$U#[$U#U<2><2><3><61><62><65><66><67><68>' , ' debug' , 1 );
@@ -1270,16 +1270,18 @@ function run_jsonlab_test(tests)
12701270 ' {U<11>_ArrayType_SU<6>singleU<11>_ArraySize_[$U#U<2><1><2>U<16>_ArrayIsComplex_TU<11>_ArrayData_[$U#[$U#U<2><2><2><1><3><2><4>}' , ' debug' , 1 );
12711271
12721272 % uuid (type 10): 16 bytes Big-Endian
1273- test_jsonlab(' uuid' , @savebj , jdict(struct(' time_low' , uint64(1427098624 ), ...
1274- ' time_mid' , uint64(58011 ), ...
1275- ' time_high' , uint64(16852 ), ...
1276- ' clock_seq' , uint64(42774 ), ...
1277- ' node' , uint64(75124066492416 )), ' kind' , ' uuid' ), ...
1273+ test_jsonlab(' uuid' , @savebj , jdict(struct(' time_low' , uint64(hex2dec( ' 550e8400 ' ) ), ...
1274+ ' time_mid' , uint64(hex2dec( ' e29b ' ) ), ...
1275+ ' time_high' , uint64(hex2dec( ' 41d4 ' ) ), ...
1276+ ' clock_seq' , uint64(hex2dec( ' a716 ' ) ), ...
1277+ ' node' , uint64(hex2dec( ' 446655440000 ' ) )), ' kind' , ' uuid' ), ...
12781278 [' EU<10>U<16>' char([85 14 132 0 226 155 65 212 167 22 68 102 85 68 0 0 ])], ' debug' , 1 );
12791279
12801280 % unknown extension round-trip (type 200)
1281- test_jsonlab(' raw extension' , @savebj , struct(' x0x5F_ByteData_' , uint8([1 , 2 , 3 , 4 ]), ' x0x5F_ExtType_' , int32(200 )), ...
1282- [' Em' char([200 0 0 0 ]) ' m' char([4 0 0 0 1 2 3 4 ])], ' debug' , 1 );
1281+ raw = jdict(uint8([1 , 2 , 3 , 4 ]), ' kind' , ' bytes' );
1282+ raw{' exttype' } = int32(200 );
1283+ test_jsonlab(' raw extension' , @savebj , raw , ...
1284+ [' EU<200>U<4>' char([1 2 3 4 ])], ' debug' , 1 );
12831285
12841286 if exist(' datetime' , ' class' )
12851287 % datetime - epoch_s (type 1): uint32 seconds since epoch
0 commit comments