From 4b1551caf4dba8cfe68d7326784b6839f54850da Mon Sep 17 00:00:00 2001 From: Crestez Dan Leonard Date: Sun, 21 Feb 2010 05:12:04 +0200 Subject: (testsuite) Replace sleep statements with explicit matching of ^C\r\n in sync_after_int --- test/lib/library.exp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test/lib/library.exp b/test/lib/library.exp index f8c41b2a..b5f914d5 100644 --- a/test/lib/library.exp +++ b/test/lib/library.exp @@ -833,19 +833,22 @@ proc start_bash {} { # Send signals QUIT & INT. # @param string $prompt (optional) Bash prompt. Default is "/@" proc sync_after_int {{prompt /@}} { + + # expect_after will uses this. set test "Sync after INT" - sleep .1 - send \031\003; # QUIT/INT - # Wait to allow bash to become ready - # See also: http://lists.alioth.debian.org/pipermail/bash-completion-devel/ - # 2010-February/002566.html - sleep .1 + + # Send QUIT/INT + send \031\003; + # NOTE: Regexp `.*' causes `expect' to discard previous unknown output. # This is necessary if a completion doesn't match expectations. # For instance with `filetype_xspec' completion (e.g. `kdvi') if # one expects `.txt' as a completion (wrong, because it isn't # there), the unmatched completions need to be cleaned up. - expect -re ".*$prompt$" + + # NOTE: Match ^C\r\n explicitly so that we don't match a previous + # unmatched prompt by accident. + expect -re ".*\\^C\\r\\n$prompt$" } -- cgit v1.2.1