Convert python test scripts to be Python 2 and 3 compatible
Unicode testing
This commit is contained in:
parent
36bb54f01d
commit
66df0bd224
6 changed files with 28 additions and 30 deletions
|
|
@ -1,10 +1,10 @@
|
|||
import li_std_wstring_inherit
|
||||
import sys
|
||||
|
||||
x = u"hello"
|
||||
x = "hello"
|
||||
|
||||
s = li_std_wstring_inherit.wstring(u"he")
|
||||
s = s + u"llo"
|
||||
s = li_std_wstring_inherit.wstring("he")
|
||||
s = s + "llo"
|
||||
|
||||
if s != x:
|
||||
raise RuntimeError("bad string mapping {} {}".format(s, x))
|
||||
|
|
@ -33,12 +33,12 @@ if not li_std_wstring_inherit.is_python_builtin():
|
|||
|
||||
b = li_std_wstring_inherit.B("hi")
|
||||
|
||||
b.name = li_std_wstring_inherit.wstring(u"hello")
|
||||
b.name = li_std_wstring_inherit.wstring("hello")
|
||||
if b.name != "hello":
|
||||
raise RuntimeError("bad string mapping")
|
||||
|
||||
|
||||
b.a = li_std_wstring_inherit.A("hello")
|
||||
if b.a != u"hello":
|
||||
if b.a != "hello":
|
||||
raise RuntimeError("bad string mapping")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue