From d94966638dd74d7acb63a2509f64d3a876a37b9a Mon Sep 17 00:00:00 2001 From: "Eric T. Johnson" Date: Sun, 24 Sep 2023 20:49:47 -0400 Subject: [PATCH 1/2] Mark failing CI tests as failed With `pipefail`, the exit code for a pipeline will be taken from the first failing command in the pipeline, rather than the last command. --- docker/run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/run_tests.sh b/docker/run_tests.sh index f867b6ee..60bcb6eb 100755 --- a/docker/run_tests.sh +++ b/docker/run_tests.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -e +set -e -o pipefail PYTHON_CMD="$(which python)" VIM="/usr/local/bin/vim" From c46341ec9f2c065837e651c32bb1b7c033d35db9 Mon Sep 17 00:00:00 2001 From: yut23 Date: Sun, 24 Sep 2023 20:17:47 -0400 Subject: [PATCH 2/2] Add tests for text containing null bytes --- test/constant.py | 2 ++ test/test_Fixes.py | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/test/constant.py b/test/constant.py index 11b4a992..d6fa4ade 100644 --- a/test/constant.py +++ b/test/constant.py @@ -18,3 +18,5 @@ COMPL_KW = chr(24) + chr(14) COMPL_ACCEPT = chr(25) + +CTRL_V = chr(22) diff --git a/test/test_Fixes.py b/test/test_Fixes.py index f0ee87ea..344ef036 100644 --- a/test/test_Fixes.py +++ b/test/test_Fixes.py @@ -1,3 +1,5 @@ +import unittest + from test.vim_test_case import VimTestCase as _VimTest from test.constant import * @@ -125,3 +127,26 @@ class PassThroughNonexecutedTrigger(_VimTest): # End: #1184 + + +# Tests for https://github.com/SirVer/ultisnips/issues/1386 (embedded null byte) + + +NULL_BYTE = CTRL_V + "000" + + +@unittest.expectedFailure +class NullByte_ListSnippets(_VimTest): + snippets = ("word", "never expanded", "", "w") + keys = "foobar" + NULL_BYTE + LS + "\n" + wanted = "foobar\x00\n" + + +@unittest.expectedFailure +class NullByte_ExpandAfter(_VimTest): + snippets = ("test", "Expand me!", "", "w") + keys = "foobar " + NULL_BYTE + "test" + EX + wanted = "foobar \x00Expand me!" + + +# End: #1386