Fix failure in gdb.ada/complete.exp

Message ID 20190528165838.17156-1-tromey@adacore.com
State New, archived
Headers

Commit Message

Tom Tromey May 28, 2019, 4:58 p.m. UTC
  I noticed a failure in gdb.ada/complete.exp when testing locally:

    FAIL: gdb.ada/complete.exp: complete break ada

This failed due to this output:

    [...]
    break ada/generated/gnatvsn.ads
    break ada/libgnat/s-excmac.ads
    break ada/sdefault.adb
    break ada/snames.adb
    break ada/snames.ads

This patch updates the regexp to allow "/" and "-" to appear.

gdb/testsuite/ChangeLog
2019-05-28  Tom Tromey  <tromey@adacore.com>

	* gdb.ada/complete.exp (test_gdb_no_completion): Add "/" and "-"
	to "break complete ada" test case's regexp.
---
 gdb/testsuite/ChangeLog            | 5 +++++
 gdb/testsuite/gdb.ada/complete.exp | 5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)
  

Comments

Joel Brobecker May 29, 2019, 3:34 p.m. UTC | #1
> I noticed a failure in gdb.ada/complete.exp when testing locally:
> 
>     FAIL: gdb.ada/complete.exp: complete break ada
> 
> This failed due to this output:
> 
>     [...]
>     break ada/generated/gnatvsn.ads
>     break ada/libgnat/s-excmac.ads
>     break ada/sdefault.adb
>     break ada/snames.adb
>     break ada/snames.ads
> 
> This patch updates the regexp to allow "/" and "-" to appear.
> 
> gdb/testsuite/ChangeLog
> 2019-05-28  Tom Tromey  <tromey@adacore.com>
> 
> 	* gdb.ada/complete.exp (test_gdb_no_completion): Add "/" and "-"
> 	to "break complete ada" test case's regexp.

Thanks for the patch, Tom. LGTM!


> ---
>  gdb/testsuite/ChangeLog            | 5 +++++
>  gdb/testsuite/gdb.ada/complete.exp | 5 +++--
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.ada/complete.exp b/gdb/testsuite/gdb.ada/complete.exp
> index 8a5ef89dddb..1746c18463d 100644
> --- a/gdb/testsuite/gdb.ada/complete.exp
> +++ b/gdb/testsuite/gdb.ada/complete.exp
> @@ -212,13 +212,14 @@ test_gdb_complete "ambiguous_func" \
>  # However, we want to sanity-check each one of them, knowing that
>  # each result should start with "break ada" and that the proposed
>  # completion should look like a valid symbol name (in particular,
> -# no uppercase letters...).  See gdb/22670.
> +# no uppercase letters...).  See gdb/22670.  File names are OK as
> +# well, which is why "/" and "-" appear in the regexp.
>  
>  gdb_test_no_output "set max-completions unlimited"
>  
>  set test "complete break ada"
>  gdb_test_multiple "$test" $test {
> -    -re "^$test$eol\(break ada(\[a-z0-9._@\])*$eol\)+$gdb_prompt $" {
> +    -re "^$test$eol\(break ada\[-a-z0-9._@/\]*$eol\)+$gdb_prompt $" {
>          pass $test
>      }
>      -re "\[A-Z\].*$gdb_prompt $" {
> -- 
> 2.20.1
  

Patch

diff --git a/gdb/testsuite/gdb.ada/complete.exp b/gdb/testsuite/gdb.ada/complete.exp
index 8a5ef89dddb..1746c18463d 100644
--- a/gdb/testsuite/gdb.ada/complete.exp
+++ b/gdb/testsuite/gdb.ada/complete.exp
@@ -212,13 +212,14 @@  test_gdb_complete "ambiguous_func" \
 # However, we want to sanity-check each one of them, knowing that
 # each result should start with "break ada" and that the proposed
 # completion should look like a valid symbol name (in particular,
-# no uppercase letters...).  See gdb/22670.
+# no uppercase letters...).  See gdb/22670.  File names are OK as
+# well, which is why "/" and "-" appear in the regexp.
 
 gdb_test_no_output "set max-completions unlimited"
 
 set test "complete break ada"
 gdb_test_multiple "$test" $test {
-    -re "^$test$eol\(break ada(\[a-z0-9._@\])*$eol\)+$gdb_prompt $" {
+    -re "^$test$eol\(break ada\[-a-z0-9._@/\]*$eol\)+$gdb_prompt $" {
         pass $test
     }
     -re "\[A-Z\].*$gdb_prompt $" {