Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfac1c04

Browse files
committed
Make tab-completion tests more robust.
Depending on as-yet-incompletely-explained factors, readline/libeditmight choose to emit screen-control escape sequences as part ofrepainting the display. I'd tried to make the test patterns avoidmatching parts of the output that are likely to contain such, butit seems that there's really no way around matching them explicitlyin some places, unless we want to just give up testing some behaviorssuch as display of alternatives.Per report from Peter Geoghegan.Discussion:https://postgr.es/m/CAH2-WznPzfWHu8PQwv1Qjpf4wQVPaaWpoO5NunFz9zsYKB4uJA@mail.gmail.com
1 parent3fd40b6 commitfac1c04

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

‎src/bin/psql/t/010_tab_completion.pl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
my$historyfile ="${TestLib::log_path}/010_psql_history.txt";
3939
$ENV{PSQL_HISTORY} =$historyfile;
4040

41+
# Ensure that readline/libedit puts out xterm escapes, not something else.
42+
$ENV{TERM} ='xterm';
43+
44+
# regexp to match one xterm escape sequence (CSI style only, for now)
45+
my$escseq ="(\e\\[[0-9;]*[A-Za-z])";
46+
4147
# fire up an interactive psql session
4248
my$in ='';
4349
my$out ='';
@@ -101,8 +107,12 @@ sub clear_query
101107
"select\\* from my\a?tab",
102108
"complete my<tab> to mytab when there are multiple choices");
103109

104-
# some versions of readline/libedit require two tabs here, some only need one
105-
check_completion("\t\t","mytab123 +mytab246",
110+
# some versions of readline/libedit require two tabs here, some only need one.
111+
# also, some might issue escape sequences to reposition the cursor, clear the
112+
# line, etc, instead of just printing some spaces.
113+
check_completion(
114+
"\t\t",
115+
"mytab$escseq*123( |$escseq)+mytab$escseq*246",
106116
"offer multiple table choices");
107117

108118
check_completion("2\t","246",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp