From: Dobrica Pavlinusic Date: Sat, 23 Feb 2019 13:39:05 +0000 (+0100) Subject: match expect on prefix to enable different number of documents X-Git-Url: http://git.rot13.org/?p=safeq;a=commitdiff_plain;h=8526ed608692528375db43b2f963e566af498c24 match expect on prefix to enable different number of documents --- 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;