micropython/tests/basics/string_join.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
713 B
Python
Raw Normal View History

print(','.join(()))
print(','.join(('a',)))
print(','.join(('a', 'b')))
print(','.join([]))
print(','.join(['a']))
print(','.join(['a', 'b']))
print(''.join(''))
print(''.join('abc'))
print(','.join('abc'))
print(','.join('abc' for i in range(5)))
2014-05-11 19:13:01 +01:00
print(b','.join([b'abc', b'123']))
try:
''.join(None)
except TypeError:
print("TypeError")
2014-05-11 19:13:01 +01:00
try:
print(b','.join(['abc', b'123']))
except TypeError:
print("TypeError")
try:
print(','.join([b'abc', b'123']))
except TypeError:
print("TypeError")
# joined by the compiler
print("a" "b")
print("a" '''b''')
print("a" # inline comment
"b")
print("a" \
"b")
# the following should not be joined by the compiler
x = 'a'
'b'
print(x)