Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- move BOM handling to the decode_text
Signed-off-by: SSE4 <tomskside@gmail.com>
- Loading branch information
Showing
2 changed files
with
41 additions
and
15 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
conans/test/unittests/client/util/files/decode_text_test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import unittest | ||
|
||
from parameterized import parameterized | ||
|
||
from conans.util.files import decode_text | ||
|
||
|
||
class DecodeTextTest(unittest.TestCase): | ||
|
||
@parameterized.expand([(b'\x41',), | ||
(b'\xef\xbb\xbf\x41',), | ||
(b'\xfe\xff\x00\x41',), | ||
(b'\xff\xfe\x41\x00',), | ||
(b'\x00\x00\xfe\xff\x00\x00\x00\x41',), | ||
(b'\xff\xfe\x00\x00\x41\x00\x00\x00',), | ||
(b'\x2b\x2f\x76\x38\x41',), | ||
(b'\x2b\x2f\x76\x39\x41',), | ||
(b'\x2b\x2f\x76\x2B\x41',), | ||
(b'\x2b\x2f\x76\x2F\x41',), | ||
(b'\x2b\x2f\x76\x38\x2d\x41',)]) | ||
def test_encodings(self, text): | ||
self.assertEqual('A', decode_text(text)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters