From 8526ed608692528375db43b2f963e566af498c24 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sat, 23 Feb 2019 14:39:05 +0100 Subject: [PATCH] match expect on prefix to enable different number of documents --- terminal-emulator.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terminal-emulator.pl b/terminal-emulator.pl index 781d353..e4ee9a1 100755 --- a/terminal-emulator.pl +++ b/terminal-emulator.pl @@ -31,7 +31,7 @@ my @send_receive = grep { /^.+$/ } split(/\n/, q{ .CARD OK Ime Prezime (nobody@example.com) .ACTION -.ACTION CMENUS0 +.ACTION CMENUS .NOP .NOP @@ -62,7 +62,7 @@ while ( @send_receive ) { $got =~ s/[\r\n]+$//; warn "# send/expect/got ",dump($send,$expect,$got); warn "<< $got\n"; - if ( $expect ne $got ) { + if ( $expect ne substr($got,0,length($expect)) ) { warn "ERROR expected [$expect] got [$got]\n"; print "Response>"; my $r = ; chomp $r; -- 2.20.1