End to end test suite for Mosh sessions.
For original messy development history, see https://github.com/cgull/mosh/tree/localhost or https://github.com/cgull/mosh/commit/e7feed48a4a271e2977f714f58acfa04cdaa5cca
This commit is contained in:
Executable
+61
@@ -0,0 +1,61 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# This test is for the first Unicode issue described on the Mosh web
|
||||
# page, a combining character drawn on a cell after returning the
|
||||
# cursor to that cell.
|
||||
#
|
||||
# XXX This test is fragile because it depends on tmux's unicode rendering.
|
||||
# The baseline and variant tests produce different (but valid) outputs
|
||||
# that are visually identical. The variant test is not run or validated.
|
||||
#
|
||||
|
||||
fail()
|
||||
{
|
||||
printf "$@" 2>&1
|
||||
exit 99
|
||||
}
|
||||
|
||||
|
||||
|
||||
PATH=$PATH:.:$srcdir
|
||||
# Top-level wrapper.
|
||||
if [ $# -eq 0 ]; then
|
||||
e2e-test $0 baseline post
|
||||
exit
|
||||
fi
|
||||
|
||||
# OK, we have arguments, we're one of the test hooks.
|
||||
if [ $# -ne 1 ]; then
|
||||
fail "bad arguments %s\n" "$@"
|
||||
fi
|
||||
|
||||
baseline()
|
||||
{
|
||||
printf 'abc\n\314\202\ndef\n'
|
||||
}
|
||||
|
||||
variant()
|
||||
{
|
||||
printf 'abc\n \314\202\ndef\n'
|
||||
}
|
||||
|
||||
post()
|
||||
{
|
||||
export LANG=C
|
||||
if grep -q "$(printf '^\302\240\314\202$')" $(basename $0).d/baseline.capture; then
|
||||
exit 0
|
||||
fi
|
||||
exit 1
|
||||
}
|
||||
|
||||
case $1 in
|
||||
baseline)
|
||||
baseline;;
|
||||
variant)
|
||||
variant;;
|
||||
post)
|
||||
post;;
|
||||
*)
|
||||
fail "unknown test argument %s\n" $1;;
|
||||
esac
|
||||
Reference in New Issue
Block a user