Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for text containing null bytes #1

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -e
set -e -o pipefail

PYTHON_CMD="$(which python)"
VIM="/usr/local/bin/vim"
Expand Down
2 changes: 2 additions & 0 deletions test/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@

COMPL_KW = chr(24) + chr(14)
COMPL_ACCEPT = chr(25)

CTRL_V = chr(22)
25 changes: 25 additions & 0 deletions test/test_Fixes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import unittest

from test.vim_test_case import VimTestCase as _VimTest
from test.constant import *

Expand Down Expand Up @@ -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
Loading