Skip to content

Commit 9136019

Browse files
committed
[ci] fix broken tests
1 parent 7d9410a commit 9136019

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

jdict.m

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -608,11 +608,7 @@
608608
% return specified data attributes, if not specified, list all attributes
609609
function val = getattr(obj, jsonpath, attrname)
610610
if (nargin == 1)
611-
if (isKey(obj.attr, obj.currentpath))
612-
val = keys(obj.attr(obj.currentpath));
613-
else
614-
val = [];
615-
end
611+
val = keys(obj.attr);
616612
return
617613
end
618614
if (nargin == 2)

test/run_jsonlab_test.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,8 +720,8 @@ function run_jsonlab_test(tests)
720720
end
721721
test_jsonlab('dims attribute in level 1', @savejson, jd7.('data'){'dims'}, '["x","y"]', 'compact', 1);
722722
test_jsonlab('other attribute in level 1', @savejson, jd7.('data'){'sampling_rate'}, '[1000]', 'compact', 1);
723-
test_jsonlab('getattr list top attr key', @savejson, jd7.getattr(), '["$.data"]', 'compact', 1);
724-
test_jsonlab('getattr return all attributes', @savejson, jd7.getattr('$.data').v(), '{"dims":["x","y"],"sampling_rate":1000}', 'compact', 1);
723+
test_jsonlab('getattr list top attr key', @savejson, jd7.data.getattr(), '["$.data"]', 'compact', 1);
724+
test_jsonlab('getattr return all attributes', @savejson, jd7.data.getattr('$.data').v(), '{"dims":["x","y"],"sampling_rate":1000}', 'compact', 1);
725725
test_jsonlab('getattr get one attr', @savejson, jd7.getattr('$.data', 'dims').v(), '["x","y"]', 'compact', 1);
726726
test_jsonlab('savejson with _ArrayLabel_', @savejson, jd7, '{"data":{"_ArrayType_":"double","_ArraySize_":[3,4],"_ArrayData_":[1,1,1,1,1,1,1,1,1,1,1,1],"_ArrayLabel_":["x","y"],"sampling_rate":1000}}', 'compact', 1);
727727
test_jsonlab('loadjson with _ArrayLabel_', @savejson, loadjson(jd7.tojson()).data.getattr('$', 'dims'), '["x","y"]', 'compact', 1);

0 commit comments

Comments
 (0)