From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Jacobowitz To: Fernando Nasser Cc: Eli Zaretskii , gdb@sources.redhat.com, Corinna Vinschen Subject: Re: [rfc] Completion tests failing Date: Thu, 27 Sep 2001 10:22:00 -0000 Message-id: <20010927132302.B23757@nevyn.them.org> References: <20010926211336.A31592@nevyn.them.org> <9743-Thu27Sep2001103949+0300-eliz@is.elta.co.il> <3BB314E8.77D93080@redhat.com> <20010927103401.B19151@nevyn.them.org> <3BB345F9.9CC3B68@redhat.com> X-SW-Source: 2001-09/msg00253.html On Thu, Sep 27, 2001 at 11:30:01AM -0400, Fernando Nasser wrote: > I am not 100% sure of what was Eli's intention, but I guess we would > need to add a test to add the closing quote if the filename started > with quote. (The space at the end seems normal as the completer has > found a "complete" completion (i.e., a full file name) already). > > Eli is in another time zone, so we may have to wait until tomorrow > to hear from him. > > Thanks for finding/fixing this. OK, it seems that we do not add the closing quote if there was a ., because of our readline interactions; thanks for explaining that, Eli. I've added a test for it anyway, marked XFAIL. OK to commit the attached? -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer 2001-09-27 Daniel Jacobowitz * gdb.base/completion.exp: Remove incorrect 'p "a' test. Add tests for 'p "break' (pass) and 'p "break.' (xfail). Index: completion.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/completion.exp,v retrieving revision 1.6 diff -u -r1.6 completion.exp --- completion.exp 2001/08/06 22:08:12 1.6 +++ completion.exp 2001/09/27 17:19:36 @@ -38,7 +38,9 @@ # "info ajksdlfk " no completions # "info" " " # "info " ambiguous (all info commands) -# "p \"a" no completions (string constant) +# "p \"break" unambiguous (completes to filename "break.c") +# "p \"break." unambiguous (should complete to "break.c" but does not, +# due to readline limitations) # "p 'a" ambiguous (all symbols starting with a) # "p b-a" ambiguous (all symbols starting with a) # "p b-" ambiguous (all symbols) @@ -349,20 +351,61 @@ } -send_gdb "p \"a\t" +send_gdb "p \"break\t" sleep 1 gdb_expect { - -re "^p \"a\\\x07$"\ + -re "^p \"break\\\x07$"\ { send_gdb "\n" gdb_expect { - -re "Unterminated string in expression\\..*$gdb_prompt $"\ - { pass "complete 'p a'"} - -re ".*$gdb_prompt $" { fail "complete 'p a'"} - timeout {fail "(timeout) complete 'p a'"} + -re ".*$gdb_prompt $" { fail "complete 'p \"break'"} + timeout {fail "(timeout) complete 'p \"break'"} } } - -re ".*$gdb_prompt $" { fail "complete 'p \"a'" } - timeout { fail "(timeout) complete 'p \"a'" } + -re "^p \"break\\.c\"$"\ + { send_gdb "\n" + gdb_expect { + -re ".*$gdb_prompt $" { pass "complete 'p \"break'"} + timeout {fail "(timeout) complete 'p \"break'"} + } + } + -re "^p \"break.*$" + { send_gdb "\n" + gdb_expect { + -re ".*$gdb_prompt $" { fail "complete 'p \"break'"} + timeout {fail "(timeout) complete 'p \"break'"} + } + } + -re ".*$gdb_prompt $" { fail "complete 'p \"break'" } + timeout { fail "(timeout) complete 'p \"break'" } + } + +setup_xfail "*-*-*" +send_gdb "p \"break.\t" +sleep 1 +gdb_expect { + -re "^p \"break\\.\\\x07$"\ + { send_gdb "\n" + gdb_expect { + -re ".*$gdb_prompt $" { fail "complete 'p \"break.'"} + timeout {fail "(timeout) complete 'p \"break.'"} + } + } + -re "^p \"break\\.c\"$"\ + { send_gdb "\n" + gdb_expect { + -re ".*$gdb_prompt $" { pass "complete 'p \"break.'"} + timeout {fail "(timeout) complete 'p \"break.'"} + } + } + -re "^p \"break\\..*$" + { send_gdb "\n" + gdb_expect { + -re ".*$gdb_prompt $" { fail "complete 'p \"break.'"} + timeout {fail "(timeout) complete 'p \"break.'"} + } + } + -re ".*$gdb_prompt $" { fail "complete 'p \"break.'" } + timeout { fail "(timeout) complete 'p \"break.'" } } send_gdb "p 'a\t"