# HG changeset patch # User Rik # Date 1602657158 25200 # Node ID c68b077c8fd68875fb4a8491b6278931da578dbc # Parent 967cfcde2e354e37304c2d775bb5efc9f267fd3e maint: Use parentheses around conditional expressions in test/. * fA.m, myclass2.m, foo_subsref_subsasgn.m, get.m, set.m, CPrecedenceTester2.m, CPrecedenceTester3.m, get.m, set.m, get.m, set.m, get.m, set.m, subsasgn.m, subsref.m, get.m, set.m, get.m, set.m, get.m, set.m, parent.m, recursive_nest.m, recursive_nest2.m, scope1.m, script_nest.m, varg_nest2.m: Use parentheses around conditional expressions in test/ directory. diff -r 967cfcde2e35 -r c68b077c8fd6 test/bug-35448/fA.m --- a/test/bug-35448/fA.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/bug-35448/fA.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,7 +1,7 @@ # fA.m function y = fA (x, f) global gfun - if nargin < 2 + if (nargin < 2) y = fA (x, gfun); else w = feval (f, x); diff -r 967cfcde2e35 -r c68b077c8fd6 test/bug-58593/myclass2.m --- a/test/bug-58593/myclass2.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/bug-58593/myclass2.m Tue Oct 13 23:32:38 2020 -0700 @@ -45,13 +45,13 @@ switch (S(1).subs) case 'data' % Transform: obj.data --> obj.data_ - if length (S)>1 + if (length (S)>1) B = subsasgn (obj.data_, S(2:end), B); end obj.data_ = B; case 'alldata' % Transform: obj.data --> obj.data_(1:end) - if length (S)>1 + if (length (S)>1) B = subsasgn (obj.data_(1:end), S(2:end), B); end % This statement should trigger *builtin* subsref to evaluate 'end', diff -r 967cfcde2e35 -r c68b077c8fd6 test/classdef/foo_subsref_subsasgn.m --- a/test/classdef/foo_subsref_subsasgn.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classdef/foo_subsref_subsasgn.m Tue Oct 13 23:32:38 2020 -0700 @@ -18,7 +18,7 @@ function ind = end (obj, k, n) sz = size (obj.x); - if k < n + if (k < n) ind = sz(k); else ind = prod (sz(k:end)); diff -r 967cfcde2e35 -r c68b077c8fd6 test/classes/@Blork/get.m --- a/test/classes/@Blork/get.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Blork/get.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,6 +1,6 @@ function v = get (s, propName) - switch propName + switch (propName) case 'bleek' v = s.bleek; otherwise diff -r 967cfcde2e35 -r c68b077c8fd6 test/classes/@Blork/set.m --- a/test/classes/@Blork/set.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Blork/set.m Tue Oct 13 23:32:38 2020 -0700 @@ -5,7 +5,7 @@ propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); - switch propName + switch (propName) case 'bleek' s.bleek = propValue; otherwise diff -r 967cfcde2e35 -r c68b077c8fd6 test/classes/@CPrecedenceTester2/CPrecedenceTester2.m --- a/test/classes/@CPrecedenceTester2/CPrecedenceTester2.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@CPrecedenceTester2/CPrecedenceTester2.m Tue Oct 13 23:32:38 2020 -0700 @@ -3,7 +3,7 @@ x = struct ('useless_data', pi^2); x = class (x, 'CPrecedenceTester2'); - switch flag + switch (flag) case 1 % CPrecedencetester2 > Snork superiorto ('Snork'); case 2 % CPrecedencetester2 < Snork diff -r 967cfcde2e35 -r c68b077c8fd6 test/classes/@CPrecedenceTester3/CPrecedenceTester3.m --- a/test/classes/@CPrecedenceTester3/CPrecedenceTester3.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@CPrecedenceTester3/CPrecedenceTester3.m Tue Oct 13 23:32:38 2020 -0700 @@ -3,7 +3,7 @@ x = struct ('useless_data', pi^3); x = class (x, 'CPrecedenceTester3'); - switch flag + switch (flag) case 1 % CPrecedencetester3 > Snork superiorto ('Snork'); case 2 % CPrecedencetester3 < Snork diff -r 967cfcde2e35 -r c68b077c8fd6 test/classes/@Cork/get.m --- a/test/classes/@Cork/get.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Cork/get.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,6 +1,6 @@ function v = get (s, propName) - switch propName + switch (propName) case 'click' v = s.click; otherwise diff -r 967cfcde2e35 -r c68b077c8fd6 test/classes/@Cork/set.m --- a/test/classes/@Cork/set.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Cork/set.m Tue Oct 13 23:32:38 2020 -0700 @@ -5,7 +5,7 @@ propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); - switch propName + switch (propName) case 'click' s.click = propValue; otherwise diff -r 967cfcde2e35 -r c68b077c8fd6 test/classes/@Dork/get.m --- a/test/classes/@Dork/get.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Dork/get.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,6 +1,6 @@ function v = get (s, propName) - switch propName + switch (propName) case 'gack' v = s.gack; otherwise diff -r 967cfcde2e35 -r c68b077c8fd6 test/classes/@Dork/set.m --- a/test/classes/@Dork/set.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Dork/set.m Tue Oct 13 23:32:38 2020 -0700 @@ -5,7 +5,7 @@ propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); - switch propName + switch (propName) case 'gack' s.gack = propValue; otherwise diff -r 967cfcde2e35 -r c68b077c8fd6 test/classes/@Gork/get.m --- a/test/classes/@Gork/get.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Gork/get.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,6 +1,6 @@ function v = get (s, propName) - switch propName + switch (propName) case 'cork' v = s.Cork; case 'gark' diff -r 967cfcde2e35 -r c68b077c8fd6 test/classes/@Gork/set.m --- a/test/classes/@Gork/set.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Gork/set.m Tue Oct 13 23:32:38 2020 -0700 @@ -5,7 +5,7 @@ propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); - switch propName + switch (propName) case 'cork' if (isa (propValue, 'Cork')) s.Cork = propValue; diff -r 967cfcde2e35 -r c68b077c8fd6 test/classes/@Gork/subsasgn.m --- a/test/classes/@Gork/subsasgn.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Gork/subsasgn.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,8 +1,8 @@ function g = subsasgn (g, s, x) - switch s.type + switch (s.type) case '.' - switch s.subs + switch (s.subs) case 'gyrk' g.gyrk = x; end diff -r 967cfcde2e35 -r c68b077c8fd6 test/classes/@Gork/subsref.m --- a/test/classes/@Gork/subsref.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Gork/subsref.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,8 +1,8 @@ function x = subsref (g, s) - switch s.type + switch (s.type) case '.' - switch s.subs + switch (s.subs) case 'gyrk' x = g.gyrk; end diff -r 967cfcde2e35 -r c68b077c8fd6 test/classes/@Pork/get.m --- a/test/classes/@Pork/get.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Pork/get.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,6 +1,6 @@ function v = get (s, propName) - switch propName + switch (propName) case 'gurk' v = s.gurk; otherwise diff -r 967cfcde2e35 -r c68b077c8fd6 test/classes/@Pork/set.m --- a/test/classes/@Pork/set.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Pork/set.m Tue Oct 13 23:32:38 2020 -0700 @@ -5,7 +5,7 @@ propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); - switch propName + switch (propName) case 'gurk' s.gurk = propValue; otherwise diff -r 967cfcde2e35 -r c68b077c8fd6 test/classes/@Snork/get.m --- a/test/classes/@Snork/get.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Snork/get.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,6 +1,6 @@ function v = get (s, propName) - switch propName + switch (propName) case 'gick' v = s.gick; otherwise diff -r 967cfcde2e35 -r c68b077c8fd6 test/classes/@Snork/set.m --- a/test/classes/@Snork/set.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Snork/set.m Tue Oct 13 23:32:38 2020 -0700 @@ -5,7 +5,7 @@ propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); - switch propName + switch (propName) case 'gick' s.gick = propValue; otherwise diff -r 967cfcde2e35 -r c68b077c8fd6 test/classes/@Spork/get.m --- a/test/classes/@Spork/get.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Spork/get.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,6 +1,6 @@ function v = get (s, propName) - switch propName + switch (propName) case 'geek' v = s.geek; otherwise diff -r 967cfcde2e35 -r c68b077c8fd6 test/classes/@Spork/set.m --- a/test/classes/@Spork/set.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Spork/set.m Tue Oct 13 23:32:38 2020 -0700 @@ -5,7 +5,7 @@ propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); - switch propName + switch (propName) case 'geek' s.geek = propValue; otherwise diff -r 967cfcde2e35 -r c68b077c8fd6 test/ctor-vs-method/@parent/parent.m --- a/test/ctor-vs-method/@parent/parent.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/ctor-vs-method/@parent/parent.m Tue Oct 13 23:32:38 2020 -0700 @@ -3,7 +3,7 @@ if (nargin == 0) rot = class (struct (), 'parent'); else - switch class (a) + switch (class (a)) case 'parent' %% copy constructor rot = a; diff -r 967cfcde2e35 -r c68b077c8fd6 test/nest/recursive_nest.m --- a/test/nest/recursive_nest.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/nest/recursive_nest.m Tue Oct 13 23:32:38 2020 -0700 @@ -5,7 +5,7 @@ f (20); function f (n) - if n > 0 + if (n > 0) x = x + recursive_nest_inc; f (n - 1); end diff -r 967cfcde2e35 -r c68b077c8fd6 test/nest/recursive_nest2.m --- a/test/nest/recursive_nest2.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/nest/recursive_nest2.m Tue Oct 13 23:32:38 2020 -0700 @@ -7,7 +7,7 @@ C; v = Y; function BB (m) - if m > 0 + if (m > 0) Y = Y + 1; BB(m - 1); C; diff -r 967cfcde2e35 -r c68b077c8fd6 test/nest/scope1.m --- a/test/nest/scope1.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/nest/scope1.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,7 +1,7 @@ # scope1.m function scope1 (n) value = n; - if value + if (value) C; end function A diff -r 967cfcde2e35 -r c68b077c8fd6 test/nest/script_nest.m --- a/test/nest/script_nest.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/nest/script_nest.m Tue Oct 13 23:32:38 2020 -0700 @@ -2,7 +2,7 @@ function x = script_nest A (5) function A (n) - if n <= 0 + if (n <= 0) script_nest_script; else A (n - 1); diff -r 967cfcde2e35 -r c68b077c8fd6 test/nest/varg_nest2.m --- a/test/nest/varg_nest2.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/nest/varg_nest2.m Tue Oct 13 23:32:38 2020 -0700 @@ -2,12 +2,12 @@ [a, b] = f; x = a; - if nargout == 1 + if (nargout == 1) x = a; endif function [a, b] = f - if nargout == 2 + if (nargout == 2) a = b = 5; endif endfunction