mirror of https://github.com/amol-/dukpy.git
fix: prevent crash with unicode emoji (e.g. 🏠) (#78)
* fix: prevent crash with unicode emoji (e.g. 🏠)
This commit is contained in:
parent
1a3f8193ff
commit
a237026520
|
@ -30,8 +30,14 @@ class TestEvalJS(unittest.TestCase):
|
|||
assert s == '華華'
|
||||
|
||||
def test_unicode_emoji(self):
|
||||
s = dukpy.evaljs("dukpy.c + '華'", c="🏠")
|
||||
assert s == '🏠華'
|
||||
s1 = dukpy.evaljs("dukpy.c + 'B'", c="🏠")
|
||||
assert s1 == '🏠B'
|
||||
|
||||
s2 = dukpy.evaljs("dukpy.c + 'C'", c="👍🏾")
|
||||
assert s2 == '👍🏾C'
|
||||
|
||||
s3 = dukpy.evaljs("dukpy.c + '華'", c="🏠")
|
||||
assert s3 == '🏠華'
|
||||
|
||||
def test_eval_files(self):
|
||||
testfile = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'test.js')
|
||||
|
|
Loading…
Reference in New Issue