diff options
-rw-r--r-- | src/bin/psql/t/010_tab_completion.pl | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/bin/psql/t/010_tab_completion.pl b/src/bin/psql/t/010_tab_completion.pl index 0f1d596b2bf..9cfd7ec79c7 100644 --- a/src/bin/psql/t/010_tab_completion.pl +++ b/src/bin/psql/t/010_tab_completion.pl @@ -38,11 +38,17 @@ $node->safe_psql('postgres', my $historyfile = "${TestLib::log_path}/010_psql_history.txt"; $ENV{PSQL_HISTORY} = $historyfile; -# Debug investigation -note "TERM is set to '" . ($ENV{TERM} || "<undef>") . "'"; - -# regexp to match one xterm escape sequence (CSI style only, for now) -my $escseq = "(\e\\[[0-9;]*[A-Za-z])"; +# Another pitfall for developers is that they might have a ~/.inputrc +# file that changes readline's behavior enough to affect this test. +# So ignore any such file. +$ENV{INPUTRC} = '/dev/null'; + +# Unset $TERM so that readline/libedit won't use any terminal-dependent +# escape sequences; that leads to way too many cross-version variations +# in the output. +delete $ENV{TERM}; +# Some versions of readline inspect LS_COLORS, so for luck unset that too. +delete $ENV{LS_COLORS}; # fire up an interactive psql session my $in = ''; @@ -107,12 +113,8 @@ check_completion( "select \\* from my\a?tab", "complete my<tab> to mytab when there are multiple choices"); -# some versions of readline/libedit require two tabs here, some only need one. -# also, some might issue escape sequences to reposition the cursor, clear the -# line, etc, instead of just printing some spaces. -check_completion( - "\t\t", - "mytab$escseq*123( |$escseq)+mytab$escseq*246", +# some versions of readline/libedit require two tabs here, some only need one +check_completion("\t\t", "mytab123 +mytab246", "offer multiple table choices"); check_completion("2\t", "246 ", |