aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Muller <muller@sourceware.org>2009-03-25 10:52:22 +0000
committerPierre Muller <muller@sourceware.org>2009-03-25 10:52:22 +0000
commitcc1d7add9b4b487504ee97d88a66241938d728a1 (patch)
tree6ebc11c8c98838ce5fae2fe615e9590f93ecf9a5
parent67c296a2d728a49ac5c587b816dab1c895c149e5 (diff)
downloadgdb-cc1d7add9b4b487504ee97d88a66241938d728a1.zip
gdb-cc1d7add9b4b487504ee97d88a66241938d728a1.tar.gz
gdb-cc1d7add9b4b487504ee97d88a66241938d728a1.tar.bz2
* gdb.base/completion.exp: Add a test for directory completion.
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.base/completion.exp30
2 files changed, 34 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 38837b0..7f7f6f6 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2009-03-25 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * gdb.base/completion.exp: Add a test for directory completion.
+
2009-03-22 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix a racy FAIL.
diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp
index 8797431..b937298 100644
--- a/gdb/testsuite/gdb.base/completion.exp
+++ b/gdb/testsuite/gdb.base/completion.exp
@@ -734,6 +734,36 @@ gdb_test "cd ${fullsrcdir}" \
"Working directory [string_to_regexp ${fullsrcdir}].*" \
"cd to \${srcdir}"
+
+# GDB used to fail adding / on directories, on the first try only
+send_gdb "dir ../testsu\t"
+gdb_expect {
+ -re "../testsuite/$" {
+ pass "directory completion"
+ send_gdb "gdb.bas\t"
+ }
+ -re "../testsuite $" {
+ fail "directory completion (old gdb bug)"
+ send_gdb "\b/gdb.bas\t"
+ }
+ default {
+ fail "directory completion (timeout)"
+ send_gdb "\ndir ../testsuite/gdb.bas\t"
+ }
+}
+
+gdb_expect {
+ -re "gdb.base/$" {
+ pass "directory completion 2"
+ }
+ timeout {
+ fail "directory completion 2"
+ }
+}
+
+gdb_test "\n" "" "Glob remaining of directory test"
+
+
send_gdb "complete file ./gdb.base/compl\n"
sleep 1
gdb_expect {