From 9efaeebead7374ffa7353b0b5c05af52b948619e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Tue, 1 Oct 2019 09:42:28 +0200 Subject: [PATCH] Add failing test for unicode character on chunk boundary Relates: #119 --- tests/test_shortcuts.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_shortcuts.py b/tests/test_shortcuts.py index 90d26cfb..681d3dfa 100755 --- a/tests/test_shortcuts.py +++ b/tests/test_shortcuts.py @@ -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 @@ -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)") + 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')