diff mbox

[2/3] Fix Python help() test for Python 3

Message ID 1416976561-1927-2-git-send-email-simon.marchi@ericsson.com
State Committed
Headers show

Commit Message

Simon Marchi Nov. 26, 2014, 4:36 a.m. UTC
The message displayed when using help() changed a bit with time, so this
adjusts the test accordingly.

gdb/testsuite/ChangeLog:

	* gdb.python/python.exp: Change expected reply to help().
---
 gdb/testsuite/gdb.python/python.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Joel Brobecker Nov. 27, 2014, 8:47 a.m. UTC | #1
> The message displayed when using help() changed a bit with time, so this
> adjusts the test accordingly.
> 
> gdb/testsuite/ChangeLog:
> 
> 	* gdb.python/python.exp: Change expected reply to help().

I am OK with the patch as is, and verified with Python 2.3, 2.6,
2.7 and 3.4 that "Welcome to Python" is part of the output of
the help() function. But since the purpose of the test is purely
to verify that the help() function does not hang, just verifying
that we have the prompt should achieve that goal, so I don't see
a need to extend the the expected output to match the "Welcome [...]"
message as well. I would personally just drop the "online" from
the expected output. Just my 2 cents, either way is fine.

Thank you!

> ---
>  gdb/testsuite/gdb.python/python.exp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp
> index 787a294..7b4a5b8 100644
> --- a/gdb/testsuite/gdb.python/python.exp
> +++ b/gdb/testsuite/gdb.python/python.exp
> @@ -67,7 +67,7 @@ gdb_py_test_multiple "multi-line python command" \
>  with_test_prefix "python interactive help" {
>      set test "python; help(); end"
>      gdb_test_multiple "python\nhelp()\nend" $test {
> -	-re "online help utility.*help> $" {
> +	-re "Welcome to Python.*help utility.*help> $" {
>  	    pass $test
>  
>  	    # The "quit" must be seen on the output.  A buggy GDB
> -- 
> 2.1.3
diff mbox

Patch

diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp
index 787a294..7b4a5b8 100644
--- a/gdb/testsuite/gdb.python/python.exp
+++ b/gdb/testsuite/gdb.python/python.exp
@@ -67,7 +67,7 @@  gdb_py_test_multiple "multi-line python command" \
 with_test_prefix "python interactive help" {
     set test "python; help(); end"
     gdb_test_multiple "python\nhelp()\nend" $test {
-	-re "online help utility.*help> $" {
+	-re "Welcome to Python.*help utility.*help> $" {
 	    pass $test
 
 	    # The "quit" must be seen on the output.  A buggy GDB