summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCrestez Dan Leonard <cdleonard@gmail.com>2010-02-21 05:12:04 +0200
committerCrestez Dan Leonard <cdleonard@gmail.com>2010-02-21 05:43:56 +0200
commit4b1551caf4dba8cfe68d7326784b6839f54850da (patch)
tree8dec4e155ae92a4a343e17a669a3c84520b24eb3
parentd2961d0f9033979c708cea373865a4985fe40af1 (diff)
downloadbash-completion-4b1551caf4dba8cfe68d7326784b6839f54850da.tar.gz
(testsuite) Replace sleep statements with explicit matching of ^C\r\n in sync_after_int
-rw-r--r--test/lib/library.exp17
1 files 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$"
}