@@ -17,16 +17,36 @@ function o = chain_(o, p) % --*-- Unitary tests --*--
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
noinputname=false;
ifisempty(inputname(1))
% If method is called with dot notation (eg o.chain_(p) insteady of chain(o, p)), input names
% are not defined.
noinputname=true;
end
ifvobs(o)-vobs(p)
error(['dseries::chain: dseries objects 'inputname(1)' and 'inputname(2)' must have the same number of variables!'])
ifnoinputname
error(['dseries::chain: dseries objects must have the same number of variables!'])
else
error(['dseries::chain: dseries objects 'inputname(1)' and 'inputname(2)' must have the same number of variables!'])
end
end
iffrequency(o)-frequency(p)
error(['dseries::chain: dseries objects 'inputname(1)' and 'inputname(2)' must have common frequencies!'])
ifnoinputname
error(['dseries::chain: dseries objects must have common frequencies!'])
else
error(['dseries::chain: dseries objects 'inputname(1)' and 'inputname(2)' must have common frequencies!'])
end
end
iflastdate(o)<firstdate(p)
error(['dseries::chain: The last date in 'inputname(1)' ('date2string(o.dates(end))') must not preceed the first date in 'inputname(2)' ('date2string(p.dates(1))')!'])
ifnoinputname
error(['dseries::chain: The last date in first dseries object ('date2string(o.dates(end))') must not preceed the first date in the second dseries object ('date2string(p.dates(1))')!'])
else
error(['dseries::chain: The last date in 'inputname(1)' ('date2string(o.dates(end))') must not preceed the first date in 'inputname(2)' ('date2string(p.dates(1))')!'])