From cc0d22cf4ce8fdda92ab7f09e65ec3480dc5b190 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Ry=C3=BBk=29?=
 <stepan@adjemian.eu>
Date: Mon, 6 Mar 2023 17:17:31 +0100
Subject: [PATCH] Fix integration tests.

print_equations() has been replaced by search().
---
 .../example1.mod                              |  9 ++-----
 .../2-with-time-shift/example1.mod            | 24 ++-----------------
 tests/var-expectations/2/example1.mod         |  9 ++-----
 3 files changed, 6 insertions(+), 36 deletions(-)

diff --git a/tests/pac/trend-component-19-growth-lin-comb/example1.mod b/tests/pac/trend-component-19-growth-lin-comb/example1.mod
index 5d98a310d5..e32fbc65b4 100644
--- a/tests/pac/trend-component-19-growth-lin-comb/example1.mod
+++ b/tests/pac/trend-component-19-growth-lin-comb/example1.mod
@@ -109,13 +109,8 @@ pac.estimate.iterative_ols('zpac', eparams, edata, 2005Q1:2000Q1+200);
 pac.print('pacman','zpac');
 
 // Print equations where the variable appears in
-fprintf('x1bar is in: \n')
-print_equations('x1bar')
-fprintf('\n')
-
-fprintf('x2bar is in: \n')
-print_equations('x2bar', true);
-fprintf('\n')
+search('x1bar')
+search('x2bar', 'withparamvalues')
 
 e_c_m_iterative_ols = M_.params(strmatch('e_c_m', M_.param_names, 'exact'));
 c_z_1_iterative_ols = M_.params(strmatch('c_z_1', M_.param_names, 'exact'));
diff --git a/tests/var-expectations/2-with-time-shift/example1.mod b/tests/var-expectations/2-with-time-shift/example1.mod
index 730ffb94e7..b4d6db31d8 100644
--- a/tests/var-expectations/2-with-time-shift/example1.mod
+++ b/tests/var-expectations/2-with-time-shift/example1.mod
@@ -60,29 +60,9 @@ var_expectation.initialize('varexp')
 var_expectation.update('varexp');
 
 // Print equations where the variable appears in
-fprintf('x is in: \n')
-print_equations('x')
-fprintf('\n')
-
-fprintf('y is in: \n')
-str = print_equations('y', true);
-fprintf('\n')
-
+search('x')
+search('y', 'withparamvalues')
 
 if ~isfield(M_.var_expectation.varexp, 'time_shift') || ~isequal(M_.var_expectation.varexp.time_shift, -2)
     error('Preprocessor does not honour time_shift option as expected.')
 end
-
-str = strrep(str, 'foo = .5*foo(-1)', '');
-str = strrep(str, '+ var_expectation_model_varexp_constant', '');
-str = strrep(str, '+ var_expectation_model_varexp_x_0*x(-2)', '');
-str = strrep(str, '+ var_expectation_model_varexp_y_0*y(-2)', '');
-str = strrep(str, '+ var_expectation_model_varexp_z_0*z(-2)', '');
-str = strrep(str, '+ var_expectation_model_varexp_x_1*x(-3)', '');
-str = strrep(str, '+ var_expectation_model_varexp_y_1*y(-3)', '');
-str = strrep(str, '+ var_expectation_model_varexp_z_1*z(-3)', '');
-str = strrep(str, ';', '');
-
-if ~isempty(strtrim(str))
-    error('Printed equation is wrong.')
-end
diff --git a/tests/var-expectations/2/example1.mod b/tests/var-expectations/2/example1.mod
index f4b0543870..b6e62dcd5e 100644
--- a/tests/var-expectations/2/example1.mod
+++ b/tests/var-expectations/2/example1.mod
@@ -58,13 +58,8 @@ var_expectation.initialize('varexp')
 var_expectation.update('varexp');
 
 // Print equations where the variable appears in
-fprintf('x is in: \n')
-print_equations('x')
-fprintf('\n')
-
-fprintf('y is in: \n')
-print_equations('y', true)
-fprintf('\n')
+search('x')
+search('y', 'withparamvalues')
 
 /*
 ** REMARK The VAR model is such that x depends on past values of x
-- 
GitLab