Force type consistency when comparing actual results and expected

results in unit tests (use logical type).
time-shift
Stéphane Adjemian (Telemachus) 2014-11-09 22:17:46 +01:00
parent 8fedac4d5e
commit a12e9d684a
31 changed files with 214 additions and 214 deletions

View File

@ -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

View 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

View 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) = 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(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 = 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

View 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(1)
c = 0;
c = false;
else
if a(2)>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

View 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

View 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 = 1;
c = true;
else
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

View 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 = 1;
c = true;
else
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
@ -93,10 +93,10 @@ function c = lessthan(a,b)
%$ i4 = (d5<d4);
%$
%$ % Check the results.
%$ t(1) = dassert(i1,1);
%$ t(2) = dassert(i2,0);
%$ t(3) = dassert(i3,1);
%$ t(4) = dassert(i4,1);
%$ t(1) = dassert(i1,true);
%$ t(2) = dassert(i2,false);
%$ t(3) = dassert(i3,true);
%$ t(4) = dassert(i4,true);
%$ T = all(t);
%@eof:1
@ -112,11 +112,11 @@ function c = lessthan(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(B1),0);
%$ t(4) = dassert(dd<dates(B5),ones(4,1));
%$ t(5) = dassert(dates(B5)<dd,zeros(4,1));
%$ t(6) = dassert(dates(B1)<dd,[0; ones(3,1)]);
%$ t(1) = dassert(dates(B1)<dates(B2),true);
%$ t(2) = dassert(dates(B2)<dates(B1),false);
%$ t(3) = dassert(dates(B2)<dates(B1),false);
%$ t(4) = dassert(dd<dates(B5),true(4,1));
%$ t(5) = dassert(dates(B5)<dd,false(4,1));
%$ t(6) = dassert(dates(B1)<dd,[false; true(3,1)]);
%$ T = all(t);
%@eof:2

View File

@ -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

View 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

View File

@ -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

View 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

View 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

View 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

View File

@ -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);

View File

@ -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);
%@eof:1

View File

@ -52,11 +52,11 @@ B.time(idx,2) = 1;
%$ i5 = (d5==dates('1951M1'));
%$
%$ % 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) = 1;
%$ end
%$
%$ if t(1)
%$ t(2) = dassert(all(d2==d3),1);
%$ t(2) = dassert(all(d2==d3),true);
%$ end
%$
%$ T = all(t);

View File

@ -110,7 +110,7 @@ b.dates = b_init:b_init+(nobs(b)-1);
%$
%$ if t(1)
%$ t(2) = dassert(ts1.nobs,ts2.nobs);
%$ t(3) = dassert(isequal(ts1.init,ts2.init),1);
%$ t(3) = dassert(ts1.init,ts2.init);
%$ t(4) = dassert(ts1.data,[NaN(3,3); A], 1e-15);
%$ t(5) = dassert(ts2.data,[B; NaN(4,2)], 1e-15);
%$ end
@ -142,7 +142,7 @@ b.dates = b_init:b_init+(nobs(b)-1);
%$
%$ if t(1)
%$ t(2) = dassert(ts1.nobs,ts2.nobs);
%$ t(3) = dassert(isequal(ts1.init,ts2.init),1);
%$ t(3) = dassert(ts1.init,ts2.init);
%$ t(4) = dassert(ts1.data,A, 1e-15);
%$ t(5) = dassert(ts2.data,[B; NaN(1,2)], 1e-15);
%$ end
@ -174,7 +174,7 @@ b.dates = b_init:b_init+(nobs(b)-1);
%$
%$ if t(1)
%$ t(2) = dassert(ts1.nobs,ts2.nobs);
%$ t(3) = dassert(isequal(ts1.init,ts2.init),1);
%$ t(3) = dassert(ts1.init,ts2.init);
%$ t(4) = dassert(ts1.data,A, 1e-15);
%$ t(5) = dassert(ts2.data,[B; NaN(1,2)], 1e-15);
%$ end

View File

@ -180,7 +180,7 @@ end
%$
%$ % Check the results.
%$ warning off, % Because the names of the variables are not the same...
%$ t(1) = dassert(isequal(ts,ts),1);
%$ t(1) = dassert(ts,ts);
%$ warning_config
%$ T = all(t);
%@eof:3
@ -204,7 +204,7 @@ end
%$
%$ % Check the results.
%$ warning off, % Because the names of the variables are not the same...
%$ t(1) = dassert(isequal(ts3,ts4),1);
%$ t(1) = dassert(ts3,ts4);
%$ warning_config
%$ T = all(t);
%@eof:4
@ -228,7 +228,7 @@ end
%$
%$ % Check the results.
%$ warning off, % Because the names of the variables are not the same...
%$ t(1) = dassert(isequal(ts3,ts4),1);
%$ t(1) = dassert(ts3,ts4);
%$ warning_config
%$ T = all(t);
%@eof:5

View File

@ -125,7 +125,7 @@ end
%$
%$ % Check the results.
%$ warning off, % Because the names of the variables are not the same...
%$ t(1) = dassert(isequal(ts1,ts2),1);
%$ t(1) = dassert(ts1,ts2);
%$ warning_config
%$ T = all(t);
%@eof:1
@ -148,7 +148,7 @@ end
%$
%$ % Check the results.
%$ warning off, % Because the names of the variables are not the same...
%$ t(1) = dassert(isequal(ts1,ts2),1);
%$ t(1) = dassert(ts1,ts2);
%$ warning_config
%$ T = all(t);
%@eof:2
@ -171,7 +171,7 @@ end
%$
%$ % Check the results.
%$ warning off, % Because the names of the variables are not the same...
%$ t(1) = dassert(isequal(ts1,ts2),1);
%$ t(1) = dassert(ts1,ts2);
%$ warning_config
%$ T = all(t);
%@eof:3
@ -195,7 +195,7 @@ end
%$
%$ % Check the results.
%$ warning off, % Because the names of the variables are not the same...
%$ t(1) = dassert(isequal(ts3,ts4),1);
%$ t(1) = dassert(ts3,ts4);
%$ warning_config
%$ T = all(t);
%@eof:4
@ -219,7 +219,7 @@ end
%$
%$ % Check the results.
%$ warning off, % Because the names of the variables are not the same...
%$ t(1) = dassert(isequal(ts3,ts4),1);
%$ t(1) = dassert(ts3,ts4);
%$ warning_config
%$ T = all(t);
%@eof:5

View File

@ -83,7 +83,7 @@ C = eq(A.data, B.data);
%$ end
%$
%$ if length(t)>1
%$ t(2) = dassert(a,ones(10,3));
%$ t(2) = dassert(a,logical(ones(10,3)));
%$ end
%$ T = all(t);
%@eof:1

View File

@ -172,12 +172,12 @@ function b = isnotempty_cell(CellArray)
%$ t(2) = dassert(e1.nobs,a.nobs);
%$ t(3) = dassert(e1.vobs,a.vobs);
%$ t(4) = dassert(e1.name,a.name);
%$ t(5) = dassert(isequal(e1.init,a.init),1);
%$ t(5) = dassert(e1.init,a.init);
%$ t(6) = dassert(e2.data,b.data);
%$ t(7) = dassert(e2.nobs,b.nobs);
%$ t(8) = dassert(e2.vobs,b.vobs);
%$ t(9) = dassert(e2.name,b.name);
%$ t(10) = dassert(isequal(e2.init,b.init),1);
%$ t(10) = dassert(e2.init,b.init);
%$ T = all(t);
%@eof:1

View File

@ -125,7 +125,7 @@ function a = concatenate(b,c)
%$
%$ % Check the results.
%$
%$ t(1) = dassert(isequal(ts3.init,e.init),1);
%$ t(1) = dassert(ts3.init,e.init);
%$ t(2) = dassert(ts3.freq,e.freq);
%$ t(3) = dassert(ts3.data,e.data);
%$ t(4) = dassert(ts3.name,e.name);
@ -159,7 +159,7 @@ function a = concatenate(b,c)
%$ ts3 = [ts1,ts2];
%$
%$ % Check the results.
%$ t(1) = dassert(isequal(ts3.init,e.init),1);
%$ t(1) = dassert(ts3.init,e.init);
%$ t(2) = dassert(ts3.freq,e.freq);
%$ t(3) = dassert(ts3.data,e.data);
%$ t(4) = dassert(ts3.name,e.name);
@ -193,7 +193,7 @@ function a = concatenate(b,c)
%$ ts3 = [ts1,ts2];
%$
%$ % Check the results.
%$ t(1) = dassert(isequal(ts3.init,e.init),1);
%$ t(1) = dassert(ts3.init,e.init);
%$ t(2) = dassert(ts3.freq,e.freq);
%$ t(3) = dassert(ts3.data,e.data);
%$ t(4) = dassert(ts3.name,e.name);
@ -227,7 +227,7 @@ function a = concatenate(b,c)
%$ ts3 = [ts1,ts2];
%$
%$ % Check the results.
%$ t(1) = dassert(isequal(ts3.init,e.init),1);
%$ t(1) = dassert(ts3.init,e.init);
%$ t(2) = dassert(ts3.freq,e.freq);
%$ t(3) = dassert(ts3.data,e.data);
%$ t(4) = dassert(ts3.name,e.name);
@ -260,7 +260,7 @@ function a = concatenate(b,c)
%$ ts4 = [ts1,ts2,ts3];
%$
%$ % Check the results.
%$ t(1) = dassert(isequal(ts4.init,e.init),1);
%$ t(1) = dassert(ts4.init,e.init);
%$ t(2) = dassert(ts4.freq,e.freq);
%$ t(3) = dassert(ts4.data,e.data);
%$ t(4) = dassert(ts4.name,e.name);
@ -310,7 +310,7 @@ function a = concatenate(b,c)
%$ if t(1)
%$ t(2) = dassert(ts3.freq,4);
%$ t(3) = dassert(ts3.data,X);
%$ t(4) = dassert(isequal(ts3.dates(1),dates('1950Q2')),1);
%$ t(4) = dassert(ts3.dates(1),dates('1950Q2'));
%$ end
%$
%$ T = t;

View File

@ -93,8 +93,8 @@ C = ne(A.data, B.data);
%$ t = 0;
%$ end
%$
%$ if length(t)>1
%$ t(2) = dassert(a,[ones(10,2), ones(10,1)]);
%$ if t(1)
%$ t(2) = dassert(a,logical([ones(10,2), ones(10,1)]));
%$ end
%$ T = all(t);
%@eof:1

View File

@ -107,7 +107,7 @@ ts.tex(id) = [];
%$
%$ if length(t)>1
%$ t(2) = dassert(id,0);
%$ t(2) = dassert(isequal(ts1,ts2),1);
%$ t(2) = dassert(ts1,ts2);
%$ end
%$ T = all(t);
%@eof:2

View File

@ -775,8 +775,8 @@ end
%$ t(5) = dassert(ts1.name{1},'A1');
%$ t(6) = dassert(ts1.name{3},'A3');
%$ t(7) = dassert(ts1.data,A,1e-15);
%$ t(8) = dassert(isequal(ts1.init,dd),1);
%$ t(9) = dassert(isequal(ts1.dates(1),dd),1);
%$ t(8) = dassert(ts1.init,dd);
%$ t(9) = dassert(ts1.dates(1),dd);
%$ end
%$ T = all(t);
%@eof:19
@ -807,8 +807,8 @@ end
%$ t(5) = dassert(ts1.name{1},'A1');
%$ t(6) = dassert(ts1.name{3},'A3');
%$ t(7) = dassert(ts1.data,A,1e-15);
%$ t(8) = dassert(isequal(ts1.init,dd),1);
%$ t(9) = dassert(isequal(ts1.dates(1),dd),1);
%$ t(8) = dassert(ts1.init,dd);
%$ t(9) = dassert(ts1.dates(1),dd);
%$ end
%$ T = all(t);
%@eof:20

View File

@ -293,7 +293,7 @@ end
%$ t(2) = dassert(a.nobs,e.nobs);
%$ t(3) = dassert(a.vobs,e.vobs);
%$ t(4) = dassert(a.freq,e.freq);
%$ t(5) = dassert(isequal(a.init,e.init),1);
%$ t(5) = dassert(a.init,e.init);
%$ T = all(t);
%@eof:1
@ -320,7 +320,7 @@ end
%$
%$ % Check the results.
%$ t(1) = dassert(a.data,e.data);
%$ t(2) = dassert(isequal(a.init,e.init),1);
%$ t(2) = dassert(a.init,e.init);
%$ t(3) = dassert(a.nobs,e.nobs);
%$ t(4) = dassert(a.vobs,e.vobs);
%$ t(5) = dassert(a.freq,e.freq);
@ -353,7 +353,7 @@ end
%$ t(2) = dassert(a.nobs,e.nobs);
%$ t(3) = dassert(a.vobs,e.vobs);
%$ t(4) = dassert(a.freq,e.freq);
%$ t(5) = dassert(isequal(a.init,e.init),1);
%$ t(5) = dassert(a.init,e.init);
%$ T = all(t);
%@eof:3
@ -375,7 +375,7 @@ end
%$ t(2) = dassert(A.nobs,4);
%$ t(3) = dassert(A.vobs,4);
%$ t(4) = dassert(A.freq,4);
%$ t(5) = dassert(isequal(A.init,dates('1990Q1')),1);
%$ t(5) = dassert(A.init,dates('1990Q1'));
%$ end
%$ T = all(t);
%@eof:4
@ -405,7 +405,7 @@ end
%$ t(2) = dassert(e.nobs,a.nobs);
%$ t(3) = dassert(e.vobs,a.vobs);
%$ t(4) = dassert(e.name,a.name);
%$ t(5) = dassert(isequal(e.init,a.init),1);
%$ t(5) = dassert(e.init,a.init);
%$ T = all(t);
%@eof:5
@ -442,12 +442,12 @@ end
%$ t(2) = dassert(e1.nobs,a.nobs);
%$ t(3) = dassert(e1.vobs,a.vobs);
%$ t(4) = dassert(e1.name,a.name);
%$ t(5) = dassert(isequal(e1.init,a.init),1);
%$ t(5) = dassert(e1.init,a.init);
%$ t(6) = dassert(e2.data,b.data);
%$ t(7) = dassert(e2.nobs,b.nobs);
%$ t(8) = dassert(e2.vobs,b.vobs);
%$ t(9) = dassert(e2.name,b.name);
%$ t(10) = dassert(isequal(e2.init,b.init),1);
%$ t(10) = dassert(e2.init,b.init);
%$ T = all(t);
%@eof:6
@ -516,7 +516,7 @@ end
%$ t(2) = dassert(e.nobs,a.nobs);
%$ t(3) = dassert(e.vobs,a.vobs);
%$ t(4) = dassert(e.name,a.name);
%$ t(5) = dassert(isequal(e.init,a.init),1);
%$ t(5) = dassert(e.init,a.init);
%$ T = all(t);
%@eof:9

View File

@ -97,7 +97,7 @@ function d = vertcat_(b, c)
%$
%$ % Check the results.
%$
%$ t(1) = dassert(isequal(ts3.init,e.init),1);
%$ t(1) = dassert(ts3.init,e.init);
%$ t(2) = dassert(ts3.freq,e.freq);
%$ t(3) = dassert(ts3.data,e.data);
%$ t(4) = dassert(ts3.name,e.name);
@ -133,7 +133,7 @@ function d = vertcat_(b, c)
%$
%$ % Check the results.
%$
%$ t(1) = dassert(isequal(ts4.init,e.init),1);
%$ t(1) = dassert(ts4.init,e.init);
%$ t(2) = dassert(ts4.freq,e.freq);
%$ t(3) = dassert(ts4.data,e.data);
%$ t(4) = dassert(ts4.name,e.name);

View File

@ -109,7 +109,7 @@ end
%$
%$ % Check the results.
%$ t(2) = dassert(freq,12);
%$ t(3) = dassert(isa(init,'dates'),1);
%$ t(3) = dassert(isa(init,'dates'),true);
%$ t(4) = dassert(init.freq,12);
%$ t(5) = dassert(init.time,[1938 11]);
%$ t(6) = dassert(varlist,{'hagop';'bedros'});
@ -143,7 +143,7 @@ end
%$
%$ % Check the results.
%$ t(2) = dassert(freq,12);
%$ t(3) = dassert(isa(init,'dates'),1);
%$ t(3) = dassert(isa(init,'dates'),true);
%$ t(4) = dassert(init.freq,12);
%$ t(5) = dassert(init.time,[1938 11]);
%$ t(6) = dassert(varlist,{'hagop';'bedros'});

View File

@ -26,7 +26,7 @@ function b = isdate(str) % --*-- Unitary tests --*--
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if isnumeric(str) && isscalar(str)
b = 1;
b = true;
return
end
@ -43,13 +43,13 @@ b = isstringdate(str);
%$ date_7 = '-1950a';
%$ date_8 = '1950m ';
%$
%$ t(1) = dassert(isdate(date_1),1);
%$ t(2) = dassert(isdate(date_2),1);
%$ t(3) = dassert(isdate(date_3),1);
%$ t(4) = dassert(isdate(date_4),0);
%$ t(5) = dassert(isdate(date_5),0);
%$ t(6) = dassert(isdate(date_6),1);
%$ t(7) = dassert(isdate(date_7),1);
%$ t(8) = dassert(isdate(date_8),0);
%$ t(1) = dassert(isdate(date_1),true);
%$ t(2) = dassert(isdate(date_2),true);
%$ t(3) = dassert(isdate(date_3),true);
%$ t(4) = dassert(isdate(date_4),false);
%$ t(5) = dassert(isdate(date_5),false);
%$ t(6) = dassert(isdate(date_6),true);
%$ t(7) = dassert(isdate(date_7),true);
%$ t(8) = dassert(isdate(date_8),false);
%$ T = all(t);
%@eof:1

View File

@ -42,13 +42,13 @@ end
%$ date_7 = '-1950a';
%$ date_8 = '1950m ';
%$
%$ t(1) = dassert(isstringdate(date_1),1);
%$ t(2) = dassert(isstringdate(date_2),1);
%$ t(3) = dassert(isstringdate(date_3),1);
%$ t(4) = dassert(isstringdate(date_4),0);
%$ t(5) = dassert(isstringdate(date_5),0);
%$ t(6) = dassert(isstringdate(date_6),1);
%$ t(7) = dassert(isstringdate(date_7),1);
%$ t(8) = dassert(isstringdate(date_8),0);
%$ t(1) = dassert(isstringdate(date_1),true);
%$ t(2) = dassert(isstringdate(date_2),true);
%$ t(3) = dassert(isstringdate(date_3),true);
%$ t(4) = dassert(isstringdate(date_4),false);
%$ t(5) = dassert(isstringdate(date_5),false);
%$ t(6) = dassert(isstringdate(date_6),true);
%$ t(7) = dassert(isstringdate(date_7),true);
%$ t(8) = dassert(isstringdate(date_8),false);
%$ T = all(t);
%@eof:1

View File

@ -96,22 +96,22 @@ end
%$ t17 = name2tex('_azert_uiop_qsdfg',1);
%$ t18 = name2tex('_azert_uiop_qsdfg_',1);
%$
%$ t(1) = dassert(strcmp(t1,'\\_azert'),1);
%$ t(2) = dassert(strcmp(t2,'azert\\_'),1);
%$ t(3) = dassert(strcmp(t3,'\\_azert\\_'),1);
%$ t(4) = dassert(strcmp(t4,'azert\\_uiop'),1);
%$ t(5) = dassert(strcmp(t5,'azert\\_uiop\\_qsdfg'),1);
%$ t(6) = dassert(strcmp(t6,'azert\\_uiop\\_qsdfg\\_'),1);
%$ t(7) = dassert(strcmp(t7,'\\_azert\\_uiop\\_qsdfg'),1);
%$ t(8) = dassert(strcmp(t8,'\\_azert\\_uiop\\_qsdfg\\_'),1);
%$ t(9) = dassert(strcmp(t11,'\\_azert'),1);
%$ t(10) = dassert(strcmp(t12,'azert\\_'),1);
%$ t(11) = dassert(strcmp(t13,'\\_azert\\_'),1);
%$ t(12) = dassert(strcmp(t14,'azert_{uiop}'),1);
%$ t(13) = dassert(strcmp(t15,'azert\\_uiop_{qsdfg}'),1);
%$ t(14) = dassert(strcmp(t16,'azert\\_uiop_{qsdfg\\_}'),1);
%$ t(15) = dassert(strcmp(t17,'\\_azert\\_uiop_{qsdfg}'),1);
%$ t(16) = dassert(strcmp(t18,'\\_azert\\_uiop_{qsdfg\\_}'),1);
%$ t(1) = dassert(strcmp(t1,'\\_azert'),true);
%$ t(2) = dassert(strcmp(t2,'azert\\_'),true);
%$ t(3) = dassert(strcmp(t3,'\\_azert\\_'),true);
%$ t(4) = dassert(strcmp(t4,'azert\\_uiop'),true);
%$ t(5) = dassert(strcmp(t5,'azert\\_uiop\\_qsdfg'),true);
%$ t(6) = dassert(strcmp(t6,'azert\\_uiop\\_qsdfg\\_'),true);
%$ t(7) = dassert(strcmp(t7,'\\_azert\\_uiop\\_qsdfg'),true);
%$ t(8) = dassert(strcmp(t8,'\\_azert\\_uiop\\_qsdfg\\_'),true);
%$ t(9) = dassert(strcmp(t11,'\\_azert'),true);
%$ t(10) = dassert(strcmp(t12,'azert\\_'),true);
%$ t(11) = dassert(strcmp(t13,'\\_azert\\_'),true);
%$ t(12) = dassert(strcmp(t14,'azert_{uiop}'),true);
%$ t(13) = dassert(strcmp(t15,'azert\\_uiop_{qsdfg}'),true);
%$ t(14) = dassert(strcmp(t16,'azert\\_uiop_{qsdfg\\_}'),true);
%$ t(15) = dassert(strcmp(t17,'\\_azert\\_uiop_{qsdfg}'),true);
%$ t(16) = dassert(strcmp(t18,'\\_azert\\_uiop_{qsdfg\\_}'),true);
%$
%$ T = all(t);
%@eof:1