Skip to content
Snippets Groups Projects
Commit 03b2ea4f authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Added unit test for merge.

parent c6def35e
No related branches found
No related tags found
No related merge requests found
Pipeline #2154 passed
......@@ -12,7 +12,7 @@ function q = merge(o, p) % --*-- Unitary tests --*--
% REMARKS
% If dseries objects o and p have common variables, the variables in p take precedence.
% Copyright (C) 2013-2017 Dynare Team
% Copyright © 2013-2019 Dynare Team
%
% This file is part of Dynare.
%
......@@ -146,9 +146,9 @@ q.dates = q_init:q_init+(nobs(q)-1);
%$ ts2.tag('type');
%$ ts2.tag('type', 'A1', 'Flow');
%$ ts3 = merge(ts1,ts2);
%$ t(1) = 1;
%$ t(1) = true;
%$ catch
%$ t = 0;
%$ t = false;
%$ end
%$
%$ if t(1)
......@@ -177,9 +177,9 @@ q.dates = q_init:q_init+(nobs(q)-1);
%$ ts2.tag('t2');
%$ ts2.tag('t2', 'B1', 1);
%$ ts3 = merge(ts1,ts2);
%$ t(1) = 1;
%$ t(1) = true;
%$ catch
%$ t = 0;
%$ t = false;
%$ end
%$
%$ if length(t)>1
......@@ -191,3 +191,25 @@ q.dates = q_init:q_init+(nobs(q)-1);
%$ end
%$ T = all(t);
%@eof:2
%@test:3
%$ % Define two dseries objects.
%$ y = dseries(ones(4,1),'1989Q1', 'u');
%$ z = dseries(ones(4,1),'1990Q1', 'u');
%$
%$ % Merge the two objects.
%$ try
%$ x = merge(y, z);
%$ t(1) = true;
%$ catch
%$ t = false;
%$ end
%$
%$ if t(1)
%$ t(2) = dassert(x.vobs,1);
%$ t(3) = dassert(x.name{1},'u');
%$ t(4) = dassert(x.data, ones(8,1));
%$ t(5) = all(x.dates==dates('1989Q1'):dates('1990Q4'));
%$ end
%$ T = all(t);
%@eof:3
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment