changeset 25174:6fdfe4127f0f stable

deprecated-props.tst: improve version comparison * deprecate-props.tst: Use compare_versions function to correctly compare version number strings.
author John W. Eaton <jwe@octave.org>
date Mon, 09 Apr 2018 11:00:35 -0400
parents 7b1b504c2f12
children 8fdc6df8bab0 f7a8adb5758c
files test/deprecate-props.tst
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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