# HG changeset patch # User John W. Eaton # Date 1523286035 14400 # Node ID 6fdfe4127f0f29b33d045a636e363f1e4463dca6 # Parent 7b1b504c2f12d61c4d7e418db962e6e1477f7cb3 deprecated-props.tst: improve version comparison * deprecate-props.tst: Use compare_versions function to correctly compare version number strings. diff -r 7b1b504c2f12 -r 6fdfe4127f0f test/deprecate-props.tst --- a/test/deprecate-props.tst Mon Apr 09 07:54:15 2018 -0400 +++ b/test/deprecate-props.tst Mon Apr 09 11:00:35 2018 -0400 @@ -20,14 +20,11 @@ ## values (radio strings only) should not be accepted, in a given future ## version. Don't forget to add a note in the NEWS file. -%!function testprop (h, prop, vrs, val = []) -%! vrsmax = strsplit (vrs, "."); -%! vrscur = strsplit (version (), "."); -%! if (num2str (vrsmax{1}) < num2str (vrscur{1}) || -%! num2str (vrsmax{2}) < num2str (vrscur{2})) +%!function testprop (h, prop, removal_version, val = []) +%! if (compare_versions (version (), removal_version, ">=")) %! if (isempty (val) && isprop (h, prop)) %! error ("Please remove %s property %s", get (h, "type"), prop); -%! elseif (! isempty (val) && ! isempty (strfind (val, set (h, prop)))) +%! elseif (! isempty (val) && any (strcmp (val, set (h, prop)))) %! error ("Please remove '%s' from allowed values for %s property %s", %! val, get (h, "type"), prop); %! endif