### Force type consistency when comparing actual results and expected

`results in unit tests (use logical type).`
parent 8fedac4d
 ... ... @@ -52,7 +52,7 @@ end %\$ E = [ones(4,1)*1950; 1951]; %\$ E = E + [(transpose(1:4)-1)/4; 0]; %\$ if t(1) %\$ t(2) = dassert(isequal(C,E),1); %\$ t(2) = dassert(C,E); %\$ end %\$ T = all(t); %@eof:1 ... ... @@ -75,7 +75,7 @@ end %\$ E = ones(2,1)*1950; %\$ E = E + [0; .25]; %\$ if t(1) %\$ t(2) = dassert(isequal(C,E),1); %\$ t(2) = dassert(C,E); %\$ end %\$ T = all(t); %@eof:2 \ No newline at end of file
 ... ... @@ -35,7 +35,7 @@ if ~isa(A,'dates') || ~isa(B,'dates') end if ~isequal(A.freq,B.freq) C = 0; C = false; return end ... ... @@ -45,7 +45,7 @@ else if isequal(A.ndat,1) || isequal(B.ndat,1) C = transpose(all(transpose(bsxfun(@eq,A.time,B.time)))); else C = 0; C = false; end end ... ... @@ -61,9 +61,9 @@ end %\$ t3 = d1==d3; %\$ %\$ % Check the results. %\$ t(1) = dassert(t1,ones(4,1)); %\$ t(2) = dassert(t2,zeros(4,1)); %\$ t(2) = dassert(t3,[1; 0; 1; 0]); %\$ t(1) = dassert(t1,true(4,1)); %\$ t(2) = dassert(t2,false(4,1)); %\$ t(2) = dassert(t3,[true; false; true; false]); %\$ T = all(t); %@eof:1 ... ... @@ -79,9 +79,9 @@ end %\$ t3 = d1==d3; %\$ %\$ % Check the results. %\$ t(1) = dassert(t1,1); %\$ t(2) = dassert(t2,0); %\$ t(2) = dassert(t3,0); %\$ t(1) = dassert(t1,true); %\$ t(2) = dassert(t2,false); %\$ t(2) = dassert(t3,false); %\$ T = all(t); %@eof:2 ... ... @@ -96,7 +96,7 @@ end %\$ t2 = d1==d3; %\$ %\$ % Check the results. %\$ t(1) = dassert(t1,[0; 1; 0; 0]); %\$ t(2) = dassert(t2,zeros(4,1)); %\$ t(1) = dassert(t1,[false; true; false; false]); %\$ t(2) = dassert(t2,false(4,1)); %\$ T = all(t); %@eof:3
 ... ... @@ -35,7 +35,7 @@ if ~isa(A,'dates') || ~isa(B,'dates') end if ~isequal(A.freq,B.freq) C = 0; C = false; return end ... ... @@ -47,32 +47,32 @@ if isequal(A.ndat, B.ndat) end else if isequal(A.ndat,1) C = NaN(B.ndat,1); C = false(B.ndat,1); for i=1:B.ndat C(i) = greaterorequal(A.time, B.time(i,:)); end elseif isequal(B.ndat,1) C = NaN(A.ndat,1); C = false(A.ndat,1); for i=1:A.ndat C(i) = greaterorequal(A.time(i,:), B.time); end else C = 0; C = false; end end function c = greaterorequal(a,b) if a(1)>b(1) c = 1; c = true; else if a(1)=b(2) c = 1; c = true; else c = 0; c = false; end end end ... ... @@ -97,11 +97,11 @@ function c = greaterorequal(a,b) %\$ i5 = (d5>=d5); %\$ %\$ % Check the results. %\$ t(1) = dassert(i1,0); %\$ t(2) = dassert(i2,1); %\$ t(3) = dassert(i3,0); %\$ t(4) = dassert(i4,0); %\$ t(5) = dassert(i5,1); %\$ t(1) = dassert(i1,false); %\$ t(2) = dassert(i2,true); %\$ t(3) = dassert(i3,false); %\$ t(4) = dassert(i4,false); %\$ t(5) = dassert(i5,true); %\$ T = all(t); %@eof:1 ... ... @@ -117,11 +117,11 @@ function c = greaterorequal(a,b) %\$ dd = dates(B1,B2,B3,B4); %\$ %\$ % Check the results. %\$ t(1) = dassert(dates(B1)>=dates(B2),0); %\$ t(2) = dassert(dates(B2)>=dates(B1),1); %\$ t(3) = dassert(dates(B2)>=dates(B2),1); %\$ t(4) = dassert(dd>=dates(B5),zeros(4,1)); %\$ t(5) = dassert(dates(B5)>=dd,ones(4,1)); %\$ t(6) = dassert(dates(B1)>=dd,[1; zeros(3,1)]); %\$ t(1) = dassert(dates(B1)>=dates(B2),false); %\$ t(2) = dassert(dates(B2)>=dates(B1),true); %\$ t(3) = dassert(dates(B2)>=dates(B2),true); %\$ t(4) = dassert(dd>=dates(B5),false(4,1)); %\$ t(5) = dassert(dates(B5)>=dd,true(4,1)); %\$ t(6) = dassert(dates(B1)>=dd,[true; false(3,1)]); %\$ T = all(t); %@eof:2 \ No newline at end of file
 ... ... @@ -35,43 +35,43 @@ if ~isa(A,'dates') || ~isa(B,'dates') end if ~isequal(A.freq,B.freq) C = 0; C = false; return end if isequal(A.ndat, B.ndat) C = NaN(A.ndat,1); C = false(A.ndat,1); for i=1:A.ndat C(i) = greaterthan(A.time(i,:), B.time(i,:)); end else if isequal(A.ndat,1) C = NaN(B.ndat,1); C = false(B.ndat,1); for i=1:B.ndat C(i) = greaterthan(A.time, B.time(i,:)); end elseif isequal(B.ndat,1) C = NaN(A.ndat,1); C = false(A.ndat,1); for i=1:A.ndat C(i) = greaterthan(A.time(i,:), B.time); end else C = 0; C = false; end end function c = greaterthan(a,b) if a(1)>b(1) c = 1; c = true; else if a(1)b(2) c = 1; c = true; else c = 0; c = false; end end end ... ... @@ -94,10 +94,10 @@ function c = greaterthan(a,b) %\$ i4 = (d5>d4); %\$ %\$ % Check the results. %\$ t(1) = dassert(i1,0); %\$ t(2) = dassert(i2,1); %\$ t(3) = dassert(i3,0); %\$ t(4) = dassert(i4,0); %\$ t(1) = dassert(i1,false); %\$ t(2) = dassert(i2,true); %\$ t(3) = dassert(i3,false); %\$ t(4) = dassert(i4,false); %\$ T = all(t); %@eof:1 ... ... @@ -113,11 +113,11 @@ function c = greaterthan(a,b) %\$ dd = dates(B1,B2,B3,B4); %\$ %\$ % Check the results. %\$ t(1) = dassert(dates(B1)>dates(B2),0); %\$ t(2) = dassert(dates(B2)>dates(B1),1); %\$ t(3) = dassert(dates(B5)>dates(B1),1); %\$ t(4) = dassert(dd>dates(B5),zeros(4,1)); %\$ t(5) = dassert(dates(B5)>dd,ones(4,1)); %\$ t(6) = dassert(dates(B1)>dd,[0; zeros(3,1)]); %\$ t(1) = dassert(dates(B1)>dates(B2),false); %\$ t(2) = dassert(dates(B2)>dates(B1),true); %\$ t(3) = dassert(dates(B5)>dates(B1),true); %\$ t(4) = dassert(dd>dates(B5),false(4,1)); %\$ t(5) = dassert(dates(B5)>dd,true(4,1)); %\$ t(6) = dassert(dates(B1)>dd,false(4,1)); %\$ T = all(t); %@eof:2 \ No newline at end of file
 ... ... @@ -82,7 +82,7 @@ C.ndat = rows(time); %\$ c2 = intersect(d1,d3); %\$ %\$ % Check the results. %\$ t(1) = dassert(isequal(c1,d2),1); %\$ t(2) = dassert(isempty(c2),1); %\$ t(1) = dassert(c1,d2); %\$ t(2) = dassert(isempty(c2),true); %\$ T = all(t); %@eof:1 \ No newline at end of file
 ... ... @@ -35,7 +35,7 @@ if ~isa(A,'dates') || ~isa(B,'dates') end if ~isequal(A.freq,B.freq) C = 0; C = false; return end ... ... @@ -47,32 +47,32 @@ if isequal(A.ndat, B.ndat) end else if isequal(A.ndat,1) C = NaN(B.ndat,1); C = false(B.ndat,1); for i=1:B.ndat C(i) = lessorequal(A.time, B.time(i,:)); end elseif isequal(B.ndat,1) C = NaN(A.ndat,1); C = false(A.ndat,1); for i=1:A.ndat C(i) = lessorequal(A.time(i,:), B.time); end else C = 0; C = false; end end function c = lessorequal(a, b) if a(1)b(1) c = 0; c = false; else if a(2)<=b(2) c = 1; c = true; else c = 0; c = false; end end end ... ... @@ -97,11 +97,11 @@ function c = lessorequal(a, b) %\$ i5 = (d5<=d5); %\$ %\$ % Check the results. %\$ t(1) = dassert(i1,1); %\$ t(2) = dassert(i2,0); %\$ t(3) = dassert(i3,1); %\$ t(4) = dassert(i4,1); %\$ t(5) = dassert(i5,1); %\$ t(1) = dassert(i1,true); %\$ t(2) = dassert(i2,false); %\$ t(3) = dassert(i3,true); %\$ t(4) = dassert(i4,true); %\$ t(5) = dassert(i5,true); %\$ T = all(t); %@eof:1 ... ... @@ -117,11 +117,11 @@ function c = lessorequal(a, b) %\$ dd = dates(B1,B2,B3,B4); %\$ %\$ % Check the results. %\$ t(1) = dassert(dates(B1)<=dates(B2),1); %\$ t(2) = dassert(dates(B2)<=dates(B1),0); %\$ t(3) = dassert(dates(B2)<=dates(B2),1); %\$ t(4) = dassert(dd<=dates(B5),ones(4,1)); %\$ t(5) = dassert(dates(B5)<=dd,zeros(4,1)); %\$ t(6) = dassert(dates(B1)<=dd,ones(4,1)); %\$ t(1) = dassert(dates(B1)<=dates(B2),true); %\$ t(2) = dassert(dates(B2)<=dates(B1),false); %\$ t(3) = dassert(dates(B2)<=dates(B2),true); %\$ t(4) = dassert(dd<=dates(B5),true(4,1)); %\$ t(5) = dassert(dates(B5)<=dd,false(4,1)); %\$ t(6) = dassert(dates(B1)<=dd,true(4,1)); %\$ T = all(t); %@eof:2 \ No newline at end of file
 ... ... @@ -35,42 +35,42 @@ if ~isa(A,'dates') || ~isa(B,'dates') end if ~isequal(A.freq,B.freq) C = 0; C = false; return end if isequal(A.ndat, B.ndat) C = NaN(A.ndat,1); C = false(A.ndat,1); for i=1:A.ndat C(i) = lessthan(A.time(i,:),B.time(i,:)); end else if isequal(A.ndat,1) C = NaN(B.ndat,1); C = false(B.ndat,1); for i=1:B.ndat C(i) = lessthan(A.time,B.time(i,:)); end elseif isequal(B.ndat,1) C = NaN(A.ndat,1); C = false(A.ndat,1); for i=1:A.ndat C(i) = lessthan(A.time(i,:),B.time); end else C = 0; C = false; end end function c = lessthan(a,b) if a(1)b(1) c = 0; c = false; else if a(2)
 ... ... @@ -111,8 +111,8 @@ end %\$ end %\$ %\$ if t(1) %\$ t(2) = dassert(isequal(e1,d2),1); %\$ t(3) = dassert(isequal(e2,d1),1); %\$ t(2) = dassert(e1,d2); %\$ t(3) = dassert(e2,d1); %\$ end %\$ T = all(t); %@eof:3 ... ... @@ -130,7 +130,7 @@ end %\$ end %\$ %\$ if t(1) %\$ t(2) = dassert(isequal(e1,f1),1); %\$ t(2) = dassert(e1,f1); %\$ end %\$ T = all(t); %@eof:4 ... ... @@ -148,7 +148,7 @@ end %\$ end %\$ %\$ if t(1) %\$ t(2) = dassert(isequal(e1,f1),1); %\$ t(2) = dassert(e1,f1); %\$ end %\$ T = all(t); %@eof:5 \ No newline at end of file
 ... ... @@ -35,7 +35,7 @@ if ~isdates(A) || ~isdates(B) end if ~isequal(A.freq,B.freq) C = 0; C = false; return end ... ... @@ -45,7 +45,7 @@ else if isequal(A.ndat,1) || isequal(B.ndat,1) C = transpose(any(transpose(bsxfun(@ne,A.time,B.time)))); else C = 0; C = false; end end ... ... @@ -61,9 +61,9 @@ end %\$ t3 = d1~=d3; %\$ %\$ % Check the results. %\$ t(1) = dassert(t1,zeros(4,1)); %\$ t(2) = dassert(t2,ones(4,1)); %\$ t(3) = dassert(t3,[0; 1; 0; 1]); %\$ t(1) = dassert(t1,false(4,1)); %\$ t(2) = dassert(t2,true(4,1)); %\$ t(3) = dassert(t3,[false; true; false; true]); %\$ T = all(t); %@eof:1 ... ... @@ -79,9 +79,9 @@ end %\$ t3 = d1~=d3; %\$ %\$ % Check the results. %\$ t(1) = dassert(t1,0); %\$ t(2) = dassert(t2,1); %\$ t(3) = dassert(t3,1); %\$ t(1) = dassert(t1,false); %\$ t(2) = dassert(t2,true); %\$ t(3) = dassert(t3,true); %\$ T = all(t); %@eof:2 ... ... @@ -96,7 +96,7 @@ end %\$ t2 = d1~=d3; %\$ %\$ % Check the results. %\$ t(1) = dassert(t1,[1; 0; 1; 1]); %\$ t(2) = dassert(t2,ones(4,1)); %\$ t(1) = dassert(t1,[true; false; true; true]); %\$ t(2) = dassert(t2,true(4,1)); %\$ T = all(t); %@eof:3
 ... ... @@ -63,8 +63,8 @@ end %\$ end %\$ %\$ if t(1) %\$ t(2) = dassert(isequal(e1,d3),1); %\$ t(3) = dassert(isequal(e2,dates('1950Q1','1950Q2','1950Q3','1950Q4','1950Q1','1950Q2','1950Q3','1950Q4')),1); %\$ t(2) = dassert(e1,d3); %\$ t(3) = dassert(e2,dates('1950Q1','1950Q2','1950Q3','1950Q4','1950Q1','1950Q2','1950Q3','1950Q4')); %\$ end %\$ T = all(t); %@eof:1 ... ... @@ -91,11 +91,11 @@ end %\$ end %\$ %\$ if t(1) %\$ t(2) = dassert(isequal(e1,f1),1); %\$ t(3) = dassert(isequal(e2,f2),1); %\$ t(4) = dassert(isequal(e3,f3),1); %\$ t(5) = dassert(isequal(e4,f4),1); %\$ t(6) = dassert(isequal(e5,f5),1); %\$ t(2) = dassert(e1,f1); %\$ t(3) = dassert(e2,f2); %\$ t(4) = dassert(e3,f3); %\$ t(5) = dassert(e4,f4); %\$ t(6) = dassert(e5,f5); %\$ end %\$ T = all(t); %@eof:2 ... ... @@ -122,11 +122,11 @@ end %\$ end %\$ %\$ if t(1) %\$ t(2) = dassert(isequal(e1,f1),1); %\$ t(3) = dassert(isequal(e2,f2),1); %\$ t(4) = dassert(isequal(e3,f3),1); %\$ t(5) = dassert(isequal(e4,f4),1); %\$ t(6) = dassert(isequal(e5,f5),1); %\$ t(2) = dassert(e1,f1); %\$ t(3) = dassert(e2,f2); %\$ t(4) = dassert(e3,f3); %\$ t(5) = dassert(e4,f4); %\$ t(6) = dassert(e5,f5); %\$ end %\$ T = all(t); %@eof:3 \ No newline at end of file
 ... ... @@ -110,10 +110,10 @@ end %\$ d = dates(B1,B2,B3,B4); %\$ d = d.append(dates(B5)); %\$ f = d.pop(); %\$ t(1) = dassert(isequal(f,dates(B1,B2,B3,B4)),1); %\$ t(1) = dassert(f,dates(B1,B2,B3,B4)); %\$ f = d.pop(B1); %\$ t(2) = dassert(isequal(f,dates(B1,B2,B4,B5)),1); %\$ t(2) = dassert(f,dates(B1,B2,B4,B5)); %\$ g = f.pop(1); %\$ t(3) = dassert(isequal(g,dates(B2,B4,B5)),1); %\$ t(3) = dassert(g,dates(B2,B4,B5)); %\$ T = all(t); %@eof:2 \ No newline at end of file
 ... ... @@ -82,7 +82,7 @@ C.ndat = rows(time); %\$ c2 = intersect(d1,d3); %\$ %\$ % Check the results. %\$ t(1) = dassert(isequal(c1,d2),1); %\$ t(2) = dassert(isempty(c2),1); %\$ t(1) = dassert(c1,d2); %\$ t(2) = dassert(isempty(c2),logical(1)); %\$ T = all(t); %@eof:1 \ No newline at end of file
 ... ... @@ -290,8 +290,8 @@ end %\$ end %\$ %\$ if t(1) && t(2) && t(3) %\$ t(4) = dassert(isequal(r1,r2),1); %\$ t(5) = dassert(isequal(r1,r3),1); %\$ t(4) = dassert(r1,r2); %\$ t(5) = dassert(r1,r3); %\$ end %\$ T = all(t); %@eof:5 ... ... @@ -325,8 +325,8 @@ end %\$ end %\$ %\$ if t(1) && t(2) && t(3) %\$ t(4) = dassert(isequal(r1,r2),1); %\$ t(5) = dassert(isequal(r1,r3),1); %\$ t(4) = dassert(r1,r2); %\$ t(5) = dassert(r1,r3); %\$ end %\$ T = all(t); %@eof:6 ... ...
 ... ... @@ -52,11 +52,11 @@ B.time(idx,2) = B.freq; %\$ i5 = (d5==dates('1949M12')); %\$ %\$ % Check the results. %\$ t(1) = dassert(i1,1); %\$ t(2) = dassert(i2,1); %\$ t(3) = dassert(i3,1); %\$ t(4) = dassert(i4,1); %\$ t(5) = dassert(i5,1); %\$ t(1) = dassert(i1,true); %\$ t(2) = dassert(i2,true); %\$ t(3) = dassert(i3,true); %\$ t(4) = dassert(i4,true); %\$ t(5) = dassert(i5,true); %\$ T = all(t); %@eof:1 ... ... @@ -71,7 +71,7 @@ B.time(idx,2) = B.freq; %\$ end %\$ %\$ if t(1) %\$ t(2) = dassert(all(d2==d3),1); %\$ t(2) = dassert(all(d2==d3),true); %\$ end %\$ %\$ T = all(t); ... ...
 ... ... @@ -49,10 +49,10 @@ D = sort(unique(horzcat(varargin{:}))); %\$ e5 = union(d1,d2,d3,d2); %\$ %\$ % Check the results. %\$ t(1) = dassert(isequal(e1,d1),1); %\$ t(2) = dassert(isequal(e2,d1+d2),1); %\$ t(3) = dassert(isequal(e3,d1+d2+d3),1); %\$ t(4) = dassert(isequal(e4,d1+d2+d3),1); %\$ t(5) = dassert(isequal(e5,d1+d2+d3),1); %\$ t(1) = dassert(e1,d1); %\$ t(2) = dassert(e2,d1+d2); %\$ t(3) = dassert(e3,d1+d2+d3); %\$ t(4) = dassert(e4,d1+d2+d3); %\$ t(5) = dassert(e5,d1+d2+d3); %\$ T = all(t);