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 5d98a310d530d64b8a5a9efda592cf02a7e7f4a2..e32fbc65b46b2696b48ff90bc95126e7c7d34ef6 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 730ffb94e738fb4becb3d2dd137fd603242c50c9..b4d6db31d87abede42c0c4c3b00a0750c4991e32 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 f4b0543870aa5b98f01b4d561c04cf85df901dc7..b6e62dcd5ec988b1f87772921c3e35aa07091e7c 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