copy.m 1.22 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
function p = copy(o) % --*-- Unitary tests --*--

% Do a copy of a dseries object.
%
% INPUTS
% - o [dates]
%
% OUTPUTS
% - p [dates]

11
% Copyright (C) 2015-2017 Dynare Team
12 13 14 15 16 17
%
% This code is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
Stéphane Adjemian's avatar
Stéphane Adjemian committed
18
% Dynare dseries submodule is distributed in the hope that it will be useful,
19 20 21 22 23 24 25 26 27 28 29
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare.  If not, see <http://www.gnu.org/licenses/>.

p = dseries();
p.data  = o.data;
p.name  = o.name;
p.tex   = o.tex;
Stéphane Adjemian's avatar
Stéphane Adjemian committed
30
p.dates = o.dates;
Stéphane Adjemian's avatar
Stéphane Adjemian committed
31
p.ops   = o.ops;
32
p.tags  = o.tags;
33 34 35 36 37 38 39 40 41 42 43 44 45 46

%@test:1
%$ % Define a dates object
%$ data = rand(10,2);
%$ o = dseries(data);
%$ q = dseries(data);
%$
%$ % Call the tested routine.
%$ try
%$     p = copy(o);
%$     t(1) = true;
%$ catch
%$     t(1) = false;
%$ end
Stéphane Adjemian's avatar
Stéphane Adjemian committed
47
%$
48 49 50 51 52 53 54
%$ if t(1)
%$      o.log_();
%$      t(2) = dassert(p, q);
%$ end
%$
%$ T = all(t);
%@eof:1