Test-suite: Unify string quoting in the Python sources
This commit is contained in:
parent
c4ad3480bd
commit
fa5f519bf9
23 changed files with 146 additions and 146 deletions
|
|
@ -1,8 +1,8 @@
|
|||
import python_strict_unicode
|
||||
|
||||
test_bytes = b'hello \x01world\x99'
|
||||
BYTES = b'BYTES'
|
||||
test_unicode = u'h\udce9llo w\u00f6rld'
|
||||
test_bytes = b"hello \x01world\x99"
|
||||
BYTES = b"BYTES"
|
||||
test_unicode = u"h\udce9llo w\u00f6rld"
|
||||
|
||||
# Test that byte string inputs and outputs work as expected
|
||||
bdbl = python_strict_unicode.double_str(test_bytes)
|
||||
|
|
@ -20,12 +20,12 @@ if type(bout) != type(BYTES):
|
|||
udbl = python_strict_unicode.double_wstr(test_unicode)
|
||||
if udbl != test_unicode + test_unicode:
|
||||
raise RuntimeError("Failed to double wide string")
|
||||
if type(udbl) != type(u''):
|
||||
if type(udbl) != type(u""):
|
||||
raise RuntimeError("Wrong type output for wide string")
|
||||
uout = python_strict_unicode.same_wstr(test_unicode)
|
||||
if uout != test_unicode:
|
||||
raise RuntimeError("Failed to copy wchar_t*")
|
||||
if type(uout) != type(u''):
|
||||
if type(uout) != type(u""):
|
||||
raise RuntimeError("Wrong type output for wchar_t*")
|
||||
|
||||
# Test that overloading is handled properly
|
||||
|
|
@ -35,9 +35,9 @@ if bovr != BYTES:
|
|||
if type(bovr) != type(BYTES):
|
||||
raise RuntimeError("Wrong type output from overload")
|
||||
uovr = python_strict_unicode.overload(test_unicode)
|
||||
if uovr != u'UNICODE':
|
||||
if uovr != u"UNICODE":
|
||||
raise RuntimeError("Failed to return unicode from overload")
|
||||
if type(uovr) != type(u''):
|
||||
if type(uovr) != type(u""):
|
||||
raise RuntimeERror("Wrong type output from overload")
|
||||
|
||||
# Test that bytes aren't accepted as wide strings and unicode isn't accepted as narrow strings
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue