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

Added unitary test.

parent a5ea76d5
Branches
Tags
No related merge requests found
function from(varargin) function from(varargin) % --*-- Unitary tests --*--
% Copyright (C) 2014 Dynare Team % Copyright (C) 2014 Dynare Team
% %
...@@ -244,7 +244,7 @@ for i=1:number_of_variables ...@@ -244,7 +244,7 @@ for i=1:number_of_variables
eval(sprintf('%s = var;',current_variable)); eval(sprintf('%s = var;',current_variable));
end end
end end
variable_names
% Get the name of the assigned variable (with time index) % 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'); 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) if isempty(assignedvariablename)
...@@ -422,3 +422,17 @@ function i = isassignedvariable(var,expr) ...@@ -422,3 +422,17 @@ function i = isassignedvariable(var,expr)
end end
end end
i = 0; 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment