Skip to content

Commit

Permalink
Add failing test for unicode character on chunk boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
lubomir committed Oct 2, 2019
1 parent 17ce5b4 commit 750a0eb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import tempfile
from six.moves import StringIO

import pytest

from kobo.shortcuts import force_list, force_tuple, allof, anyof, noneof, oneof, is_empty, iter_chunks, save_to_file, read_from_file, run, read_checksum_file, compute_file_checksums, makedirs, split_path, relative_path
from six.moves import range

Expand Down Expand Up @@ -199,6 +201,13 @@ def test_run_show_cmd_logfile_stdout(self, mock_out):
self.assertEqual(mock_out.getvalue(),
'COMMAND: echo foo\n-----------------\nfoo\n')

@pytest.mark.xfail(reason="Not fixed yet (#119)", strict=True)
def test_run_split_in_middle_of_utf8_sequence(self):
logfile = os.path.join(self.tmp_dir, 'output.log')
cmd = "printf ' ' && bash -c \"printf 'č%.0s' {1..10000}\""
ret, out = run(cmd, show_cmd=True, logfile=logfile, stdout=True)
self.assertEqual(ret, 0)

@mock.patch('sys.stdout', new_callable=StringIO)
def test_run_univ_nl_logfile_stdout(self, mock_out):
logfile = os.path.join(self.tmp_dir, 'output.log')
Expand Down

0 comments on commit 750a0eb

Please sign in to comment.