summaryrefslogtreecommitdiffstatshomepage
path: root/tests/unicode
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-01-29 14:56:09 +0000
committerDamien George <damien.p.george@gmail.com>2015-01-29 14:56:09 +0000
commit92ab95f21539d94c2139974b3995699a155f5a97 (patch)
treefb1e917f68ec818edf3ba65753427682c4f51970 /tests/unicode
parent598af3a7d6bab1f106f6969ebab2d6f4e11ee963 (diff)
downloadmicropython-92ab95f21539d94c2139974b3995699a155f5a97.tar.gz
micropython-92ab95f21539d94c2139974b3995699a155f5a97.zip
tests: Add some tests to improve coverage.
Diffstat (limited to 'tests/unicode')
-rw-r--r--tests/unicode/data/utf-8_2.txt1
-rw-r--r--tests/unicode/file2.py10
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/unicode/data/utf-8_2.txt b/tests/unicode/data/utf-8_2.txt
index ab0eaa4e0d..6f142974e7 100644
--- a/tests/unicode/data/utf-8_2.txt
+++ b/tests/unicode/data/utf-8_2.txt
@@ -1 +1,2 @@
aαbβcγdδ
+ぁ🙐
diff --git a/tests/unicode/file2.py b/tests/unicode/file2.py
index b8a3419660..8c45f91faf 100644
--- a/tests/unicode/file2.py
+++ b/tests/unicode/file2.py
@@ -10,6 +10,16 @@ def do(mode):
print(f.read(1))
print(f.read(2))
print(f.read(4))
+
+ # skip to end of line
+ f.readline()
+
+ # check 3-byte utf-8 char
+ print(f.read(1 if mode == 'rt' else 3))
+
+ # check 4-byte utf-8 char
+ print(f.read(1 if mode == 'rt' else 4))
+
f.close()
do('rb')