[m-dev.] debugger/completion unit test may fail with non-standard display widths
Keri Harris
keri at gentoo.org
Wed Sep 27 18:33:09 AEST 2017
Hi,
When running the Mercury test unit tests using a non-standard terminal
width, the debugger/completion test can fail:
INPUTRC=completion.inputrc HOME=/nonexistent
MERCURY_SUPPRESS_MDB_BANNER=yes MERCURY_DEBUGGER_INIT=../mdbrc mdb
./completion \
< completion.inp 2>&1 | sed -e '/^$/d' > completion.out 2>&1
Comparing completion.out with completion.exp*,
results in completion.res
** completion.out did not match the expected output
With a terminal width set much wider than 80 columns we can get
completion.out containing entries like:
1 mdb>
2 func*completion. <snip items> func*completion.sub2.sub3.
3 func*completion.z func*completion.zz
4 b func*completion.z
5 1: + stop interface func completion.z/0-0 (det)
while the completion.exp files expect entries to be using a standard (80
column) width:
1 mdb>
2 func*completion. func*completion.sub2.
3 func*completion.sub1. func*completion.sub2.sub3.
4 func*completion.z func*completion.zz
5 b func*completion.z
6 1: + stop interface func completion.z/0-0 (det)
(I've added line numbers and snipped some of the output to get it to
format nicely in an email).
Hard coding the display width to 80 columns in completion.inputrc allows
the test to pass, irrespective of the underlying terminal width.
Attached is a patch to accomplish this.
Thanks
Keri
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mercury-tests-debugger-completion.patch
Type: text/x-patch
Size: 485 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/developers/attachments/20170927/975d7990/attachment.bin>
More information about the developers
mailing list