From 48c805ab3d01eec2cb2eb5a1a653aa7b2d007760 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 9 Jul 2012 12:37:27 -0500 Subject: [PATCH] Trap and check warning message from macLib.plt test. --- src/tools/test/macLib.plt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/tools/test/macLib.plt b/src/tools/test/macLib.plt index b0c987818..9aa455df7 100644 --- a/src/tools/test/macLib.plt +++ b/src/tools/test/macLib.plt @@ -3,7 +3,7 @@ use FindBin qw($Bin); use lib "$Bin/../../../../lib/perl"; -use Test::More tests => 34; +use Test::More tests => 35; use EPICS::macLib; @@ -12,7 +12,15 @@ use Data::Dumper; my $m = EPICS::macLib->new; isa_ok $m, 'EPICS::macLib'; is $m->expandString(''), '', 'Empty string'; -is $m->expandString('$(undef)'), undef, 'Warning $(undef)'; + +{ + local *STDERR; + my $output; + open STDERR, '>', \$output; + is $m->expandString('$(undef)'), undef, 'Warning $(undef)'; + chomp $output; + is $output, q/macLib: macro 'undef' is undefined (expanding string '$(undef)')/, 'macLib error message'; +} $m->suppressWarning(1); is $m->expandString('$(undef)'), '$(undef)', 'Suppressed $(undef)';