From a61b6d764988d7c0c523a4b5568a9ec65584a0e6 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 17 Feb 2019 10:21:45 +1100 Subject: [PATCH] Add a test case for WinDisplay segfault Fixes #2737 --- test/regression/2737-segfault-on-WinDisplay-hook/cmd | 1 + test/regression/2737-segfault-on-WinDisplay-hook/in | 1 + test/regression/2737-segfault-on-WinDisplay-hook/out | 1 + test/regression/2737-segfault-on-WinDisplay-hook/rc | 9 +++++++++ 4 files changed, 12 insertions(+) create mode 100644 test/regression/2737-segfault-on-WinDisplay-hook/cmd create mode 100644 test/regression/2737-segfault-on-WinDisplay-hook/in create mode 100644 test/regression/2737-segfault-on-WinDisplay-hook/out create mode 100644 test/regression/2737-segfault-on-WinDisplay-hook/rc diff --git a/test/regression/2737-segfault-on-WinDisplay-hook/cmd b/test/regression/2737-segfault-on-WinDisplay-hook/cmd new file mode 100644 index 00000000..fb8abceb --- /dev/null +++ b/test/regression/2737-segfault-on-WinDisplay-hook/cmd @@ -0,0 +1 @@ +:e foo diff --git a/test/regression/2737-segfault-on-WinDisplay-hook/in b/test/regression/2737-segfault-on-WinDisplay-hook/in new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/regression/2737-segfault-on-WinDisplay-hook/in @@ -0,0 +1 @@ + diff --git a/test/regression/2737-segfault-on-WinDisplay-hook/out b/test/regression/2737-segfault-on-WinDisplay-hook/out new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/regression/2737-segfault-on-WinDisplay-hook/out @@ -0,0 +1 @@ + diff --git a/test/regression/2737-segfault-on-WinDisplay-hook/rc b/test/regression/2737-segfault-on-WinDisplay-hook/rc new file mode 100644 index 00000000..d925d57d --- /dev/null +++ b/test/regression/2737-segfault-on-WinDisplay-hook/rc @@ -0,0 +1,9 @@ +hook global WinDisplay .* %{ evaluate-commands %sh{ + tmp=$(mktemp -d) + fifo="${tmp}/fifo" + mkfifo $fifo + printf "%s\n" "try %{ delete-buffer *test* } + edit! -fifo ${fifo} *test* + try %{ hook -always global KakEnd .* %{ nop %sh{ rm -rf ${tmp} } } } + map buffer normal '' ';/:2:test-jump $kak_bufname'" +}}