Skip to content

Commit 7f2c9b1

Browse files
committed
com.livecode.typeconvert: Add tests for list combine syntax
1 parent 7d157bf commit 7f2c9b1

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

tests/lcb/stdlib/typeconvert.lcb

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (C) 2015 LiveCode Ltd.
2+
Copyright (C) 2015-2016 LiveCode Ltd.
33

44
This file is part of LiveCode.
55

@@ -17,6 +17,8 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
1717

1818
module com.livecode.typeconvert.tests
1919

20+
use com.livecode.__INTERNAL._testlib
21+
2022
public handler TestSplit()
2123
-- Bug 15440
2224
variable tString
@@ -35,4 +37,23 @@ public handler TestSplitEmpty()
3537
test "split (empty)" when the number of elements in tList is 1
3638
end handler
3739

40+
private handler TestCombine_NonString()
41+
variable tString
42+
combine [1, 2, 3] with "," into tString
43+
end handler
44+
45+
public handler TestCombine()
46+
variable tString
47+
variable tList
48+
put ["a", "b", "c"] into tList
49+
50+
combine tList with "," into tString
51+
test "combine (comma)" when the number of chars in tString is 5
52+
53+
combine tList with "" into tString
54+
test "combine (empty)" when the number of chars in tString is 3
55+
56+
MCUnitTestHandlerThrows(TestCombine_NonString, "combine non-string")
57+
end handler
58+
3859
end module

0 commit comments

Comments
 (0)