Skip to content

Commit

Permalink
fix: prevent crash with unicode emoji (e.g. 🏠) (#78)
Browse files Browse the repository at this point in the history
* fix: prevent crash with unicode emoji (e.g. 🏠)
  • Loading branch information
robinvandernoord authored May 29, 2024
1 parent 1a3f819 commit a237026
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/test_evaljs.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ def test_unicode_jssrc(self):
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')
Expand Down

0 comments on commit a237026

Please sign in to comment.