mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Remove encoding dependence
This commit is contained in:
parent
3793bc32c0
commit
25c06e6525
2 changed files with 21 additions and 4 deletions
|
|
@ -41,7 +41,21 @@ def test_ignore_case(some_files, cap_out):
|
|||
|
||||
|
||||
def test_null_data(some_files, cap_out):
|
||||
ret = pygrep.main(('--null-data', r'foo.*bar', 'f1', 'f2', 'f3'))
|
||||
ret = pygrep.main(('--null-data', r'foo\nbar', 'f1', 'f2', 'f3'))
|
||||
out = cap_out.get()
|
||||
assert ret == 1
|
||||
assert out == 'f1:foobar\n'
|
||||
assert out == 'f1:0-7:foo\nbar\n'
|
||||
|
||||
|
||||
def test_null_data_dotall_flag_is_enabled(some_files, cap_out):
|
||||
ret = pygrep.main(('--null-data', r'o.*bar', 'f1', 'f2', 'f3'))
|
||||
out = cap_out.get()
|
||||
assert ret == 1
|
||||
assert out == 'f1:1-7:oo\nbar\n'
|
||||
|
||||
|
||||
def test_null_data_multiline_flag_is_enabled(some_files, cap_out):
|
||||
ret = pygrep.main(('--null-data', r'foo$.*bar', 'f1', 'f2', 'f3'))
|
||||
out = cap_out.get()
|
||||
assert ret == 1
|
||||
assert out == 'f1:0-7:foo\nbar\n'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue