From 9c92b20f33aff49d8b0688050d035a67355afb8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Fri, 27 Jun 2014 22:36:10 +0200 Subject: [PATCH] Added unitary test. --- matlab/utilities/dseries/from.m | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/matlab/utilities/dseries/from.m b/matlab/utilities/dseries/from.m index a78c95308..f46d1f0a4 100644 --- a/matlab/utilities/dseries/from.m +++ b/matlab/utilities/dseries/from.m @@ -1,4 +1,4 @@ -function from(varargin) +function from(varargin) % --*-- Unitary tests --*-- % Copyright (C) 2014 Dynare Team % @@ -244,7 +244,7 @@ for i=1:number_of_variables eval(sprintf('%s = var;',current_variable)); end end -variable_names + % Get the name of the assigned variable (with time index) assignedvariablename = regexpi(EXPRESSION(1:equal_id-1), '\w*\(t\)|\w*\(t\-\d\)|\w*\(t\+\d\)|\w*\.\w*\(t\)|\w*\.\w*\(t\-\d\)|\w*\.\w*\(t\+\d\)','match'); if isempty(assignedvariablename) @@ -421,4 +421,18 @@ function i = isassignedvariable(var,expr) return end end - i = 0; \ No newline at end of file + i = 0; + +%@test:1 +%$ try +%$ y = dseries(zeros(400,1),dates('1950Q1')) ; +%$ v = dseries(randn(400,1),dates('1950Q1')) ; +%$ u = dseries(randn(400,1),dates('1950Q1')) ; +%$ from 1950Q2 to 2049Q4 do y(t) = (1+.01*u(t))*y(t-1) + v(t) +%$ t(1) = 1; +%$ catch +%$ t(1) = 0; +%$ end +%$ +%$ T = all(t); +%@eof:1 \ No newline at end of file