Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[translation] Fix build by renaming to pyj8.py
- Loading branch information
Andy Chu
committed
Dec 25, 2023
1 parent
30e3316
commit 3f9fa6f
Showing
5 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/usr/bin/env python2 | ||
from __future__ import print_function | ||
""" | ||
j8_str.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,41 @@ | ||
#!/usr/bin/env python2 | ||
""" | ||
pyj8_test.py: Tests for pyj8.py | ||
""" | ||
from __future__ import print_function | ||
|
||
import unittest | ||
|
||
from data_lang import pyj8 # module under test | ||
|
||
|
||
class J8Test(unittest.TestCase): | ||
|
||
def testEncode(self): | ||
en = pyj8.Enc('hello', 0) | ||
print(en) | ||
|
||
en = pyj8.Enc('\xff-\xfe-\xff-\xfe', 0) | ||
print(en) | ||
|
||
# multiple errrors | ||
en = pyj8.Enc('hello\xffthere \xfe\xff gah', 0) | ||
print(en) | ||
|
||
# valid mu | ||
en = pyj8.Enc('hello \xce\xbc there', 0) | ||
print(en) | ||
|
||
# two first bytes - invalid | ||
en = pyj8.Enc('hello \xce\xce there', 0) | ||
print(en) | ||
|
||
# two cont bytes - invalid | ||
en = pyj8.Enc('hello \xbc\xbc there', 0) | ||
print(en) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() | ||
|
||
# vim: sw=4 |
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