Skip to content

Commit cd93280

Browse files
committed
fixUnitsBug: update tests
1 parent 1089cf4 commit cd93280

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tests/TestMultiTag.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,17 @@
416416
t = b.create_multi_tag('unitsTest', 'nixMultiTag', da);
417417

418418
assert(isempty(t.units));
419+
try
420+
t.units = 'mV';
421+
catch ME
422+
assert(strcmp(ME.identifier, 'MATLAB:class:SetProhibited'));
423+
end;
424+
try
425+
t.units = ['mV', 'uA'];
426+
catch ME
427+
assert(strcmp(ME.identifier, 'MATLAB:class:SetProhibited'));
428+
end;
429+
419430
units = {'mV'};
420431
t.units = {'mV'};
421432
assert(isequal(t.units,units));

tests/TestTag.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,17 @@
316316
assert(isempty(t1.definition));
317317

318318
assert(isempty(t1.units));
319+
try
320+
t1.units = 'mV';
321+
catch ME
322+
assert(strcmp(ME.identifier, 'MATLAB:class:SetProhibited'));
323+
end;
324+
try
325+
t1.units = ['mV', 'uA'];
326+
catch ME
327+
assert(strcmp(ME.identifier, 'MATLAB:class:SetProhibited'));
328+
end;
329+
319330
t1.units = {'ms', 'mV'};
320331
assert(isequal(t1.units, {'ms', 'mV'}));
321332

0 commit comments

Comments
 (0)