Skip to content

Commit 6bf2f12

Browse files
committed
[ci] fix broken ci test with string-keyed dictionary/map
1 parent 2fa6975 commit 6bf2f12

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

savejson.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@
593593
if (isempty(names{i}))
594594
outcell{idx} = obj2json('x0x0_', val{i}, level + 1, opt);
595595
else
596-
outcell{idx} = obj2json(names{i}, val{i}, level + 1, opt);
596+
outcell{idx} = obj2json(char(names{i}), val{i}, level + 1, opt);
597597
end
598598
idx = idx + 1;
599599
if (i < length(names))

test/run_jsonlab_test.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ function run_jsonlab_test(tests)
108108
'{"x0x5F_i":1,"i_":"str"}', 'compact', 1, 'UnpackHex', 0);
109109
end
110110
if (exist('containers.Map'))
111+
test_jsonlab('containers.Map with string keys', @savejson, containers.Map([string('Andy'), string('^_^')], {true, '-_-'}), ...
112+
'{"Andy":true,"^_^":"-_-"}', 'compact', 1, 'usemap', 1);
111113
test_jsonlab('containers.Map with char keys', @savejson, containers.Map({'Andy', '^_^'}, {true, '-_-'}), ...
112114
'{"Andy":true,"^_^":"-_-"}', 'compact', 1, 'usemap', 1);
113115
test_jsonlab('containers.Map with number keys', @savejson, containers.Map({1.1, 1.2}, {true, '-_-'}), ...

0 commit comments

Comments
 (0)