test: Clear socket correctly when XDG_RUNTIME_DIR is set

This commit is contained in:
Jason Felice 2019-10-03 22:18:52 -04:00
parent 081595fa2f
commit 2b1ca43328

View File

@ -60,7 +60,7 @@ main() {
number_tests=$(($number_tests + 1))
touch in; cp in out
session="kak-tests"
rm -f $tmpdir/kakoune/$USER/$session
rm -f "$(session_path $session)"
$root/../src/kak out -n -s "$session" -ui json -e "$kak_commands" > ui-out < "${ui_in}"
retval=$?
failed=0
@ -117,6 +117,14 @@ main() {
# Utility ├─────────────────────────────────────────────────────────────────────
session_path() {
if [ -n "$XDG_RUNTIME_DIR" ]; then
printf %s "${XDG_RUNTIME_DIR}/kakoune/$1"
else
printf %s "${TMPDIR:-/tmp}/kakoune/${USER}/$1"
fi
}
show_diff() {
diff -u $1 $2 | while IFS='' read -r line; do
first_character=$(printf '%s\n' "$line" | cut -b 1)