blob: e55a1281bd350633c5d97b146826d5a386f9b49f [file] [log] [blame]
Christian Eglib7d53da2021-05-26 16:35:52 +02001import unittest
2import louis
3
Christian Egli6cb7ab62021-05-27 10:33:50 +02004class TestUnicodeComposed(unittest.TestCase):
Christian Eglib7d53da2021-05-26 16:35:52 +02005
6 @unittest.expectedFailure
7 def test_1(self):
Christian Egli6cb7ab62021-05-27 10:33:50 +02008 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "😂"),
9 '"<face with tears of joy">')
Christian Eglib7d53da2021-05-26 16:35:52 +020010
Christian Eglib7d53da2021-05-26 16:35:52 +020011 def test_2(self):
Christian Egli6cb7ab62021-05-27 10:33:50 +020012 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "a 😂"),
13 'a "<face with tears of joy">')
Christian Eglib7d53da2021-05-26 16:35:52 +020014
Christian Eglib7d53da2021-05-26 16:35:52 +020015 def test_3(self):
Christian Egli6cb7ab62021-05-27 10:33:50 +020016 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "😂 b"),
17 '"<face with tears of joy"> b')
Christian Eglib7d53da2021-05-26 16:35:52 +020018
Christian Eglib7d53da2021-05-26 16:35:52 +020019 def test_4(self):
Christian Egli6cb7ab62021-05-27 10:33:50 +020020 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "a 😂 b"),
21 'a "<face with tears of joy"> b')
Christian Eglib7d53da2021-05-26 16:35:52 +020022
Christian Eglib7d53da2021-05-26 16:35:52 +020023 def test_8(self):
Christian Egli6cb7ab62021-05-27 10:33:50 +020024 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "before 😂"),
25 'before "<face with tears of joy">')
Christian Eglib7d53da2021-05-26 16:35:52 +020026
Christian Eglib7d53da2021-05-26 16:35:52 +020027 def test_9(self):
Christian Egli6cb7ab62021-05-27 10:33:50 +020028 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "😂 after"),
29 '"<face with tears of joy"> after')
Christian Eglib7d53da2021-05-26 16:35:52 +020030
Christian Eglib7d53da2021-05-26 16:35:52 +020031 def test_10(self):
Christian Egli6cb7ab62021-05-27 10:33:50 +020032 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "before 😂 after"),
33 'before "<face with tears of joy"> after')
Christian Eglib7d53da2021-05-26 16:35:52 +020034
35 @unittest.expectedFailure
36 def test_11(self):
Christian Egli6cb7ab62021-05-27 10:33:50 +020037 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "🤣"),
38 '"<rolling on the floor laughing">')
Christian Eglib7d53da2021-05-26 16:35:52 +020039
Christian Eglib7d53da2021-05-26 16:35:52 +020040 def test_12(self):
Christian Egli6cb7ab62021-05-27 10:33:50 +020041 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "a 🤣"),
42 'a "<rolling on the floor laughing">')
Christian Eglib7d53da2021-05-26 16:35:52 +020043
Christian Eglib7d53da2021-05-26 16:35:52 +020044 def test_13(self):
Christian Egli6cb7ab62021-05-27 10:33:50 +020045 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "🤣 b"),
46 '"<rolling on the floor laughing"> b')
47
48 def test_14(self):
49 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "a 🤣 b"),
50 'a "<rolling on the floor laughing"> b')
51
52class TestUnicodeDecomposed(unittest.TestCase):
Christian Eglib7d53da2021-05-26 16:35:52 +020053
54 @unittest.expectedFailure
Christian Egli6cb7ab62021-05-27 10:33:50 +020055 def test_1(self):
56 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "\ud83d\ude02"),
57 '"<face with tears of joy">')
Christian Eglib7d53da2021-05-26 16:35:52 +020058
Christian Egli6cb7ab62021-05-27 10:33:50 +020059 def test_2(self):
60 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "a \ud83d\ude02"),
61 'a "<face with tears of joy">')
62
63 def test_3(self):
64 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "\ud83d\ude02 b"),
65 '"<face with tears of joy"> b')
66
67 def test_4(self):
68 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "a \ud83d\ude02 b"),
69 'a "<face with tears of joy"> b')
70
71 def test_8(self):
72 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "before \ud83d\ude02"),
73 'before "<face with tears of joy">')
74
75 def test_9(self):
76 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "\ud83d\ude02 after"),
77 '"<face with tears of joy"> after')
78
79 def test_10(self):
80 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "before \ud83d\ude02 after"),
81 'before "<face with tears of joy"> after')
82
83 @unittest.expectedFailure
84 def test_11(self):
85 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "\ud83e\udd23"),
86 '"<rolling on the floor laughing">')
87
88 def test_12(self):
89 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "a \ud83e\udd23"),
90 'a "<rolling on the floor laughing">')
91
92 def test_13(self):
93 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "\ud83e\udd23 b"),
94 '"<rolling on the floor laughing"> b')
95
96 def test_14(self):
97 self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "a \ud83e\udd23 b"),
98 'a "<rolling on the floor laughing"> b')
Christian Eglib7d53da2021-05-26 16:35:52 +020099if __name__ == '__main__':
100 unittest.main()