From d87c6b676855a8f19586e7ac637fe5f1dbc31cbc Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 17 Feb 2017 12:30:27 +1100 Subject: tests/basics/string_join: Add more tests for string concatenation. --- tests/basics/string_join.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/basics/string_join.py') diff --git a/tests/basics/string_join.py b/tests/basics/string_join.py index b8694c01e0..4a2e9aa913 100644 --- a/tests/basics/string_join.py +++ b/tests/basics/string_join.py @@ -25,3 +25,13 @@ except 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) -- cgit v1.2.3 From 38c3778b2701fb2cdd071d075c1a3af026eaccd7 Mon Sep 17 00:00:00 2001 From: Krzysztof Blazewicz Date: Sat, 4 Mar 2017 12:34:58 +0100 Subject: tests/basics/string_join.py: Add test case where argument is not iterable. --- tests/basics/string_join.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/basics/string_join.py') diff --git a/tests/basics/string_join.py b/tests/basics/string_join.py index 4a2e9aa913..82f1b799a0 100644 --- a/tests/basics/string_join.py +++ b/tests/basics/string_join.py @@ -13,6 +13,11 @@ print(','.join('abc' for i in range(5))) print(b','.join([b'abc', b'123'])) +try: + ''.join(None) +except TypeError: + print("TypeError") + try: print(b','.join(['abc', b'123'])) except TypeError: -- cgit v1.2.3