#QUALITY by cg
authorClaus Gittinger <cg@exept.de>
Sat, 21 Jul 2018 14:10:41 +0200
changeset 1991 522d8744231d
parent 1990 add7e46a1fac
child 1992 5cfaf842bed0
#QUALITY by cg class: RegressionTests::StringTests added: #test69_split
RegressionTests__StringTests.st
--- a/RegressionTests__StringTests.st	Thu Jul 19 11:18:07 2018 +0200
+++ b/RegressionTests__StringTests.st	Sat Jul 21 14:10:41 2018 +0200
@@ -1233,6 +1233,26 @@
     "
 !
 
+test69_split
+    self assert:(('a,b,c,d' splitByAny:',;') sameContentsAs: #('a' 'b' 'c' 'd')).
+    self assert:(('a;b;c;d' splitByAny:',;') sameContentsAs: #('a' 'b' 'c' 'd')).
+    self assert:(('a;b,c;d' splitByAny:',;') sameContentsAs: #('a' 'b' 'c' 'd')).
+
+    self assert:(($, split:'a,b,c,d') sameContentsAs: #('a' 'b' 'c' 'd')).
+    self assert:((',' split:'a,b,c,d') sameContentsAs: #('a' 'b' 'c' 'd')).
+    self assert:(('//' split:'a//b//c//d') sameContentsAs: #('a' 'b' 'c' 'd')).
+    self assert:(('a//b//c//d' splitOn:'//') sameContentsAs: #('a' 'b' 'c' 'd')).
+
+    "/ self assert:(([:ch | ch isLetter] split:'a2b3c4') sameContentsAs: #('1' '2' '3' '4')).
+    "/ self assert:(([:char | char isDigit] split: '1a2b3c4') sameContentsAs: #('a' 'b' 'c')).
+
+    "
+     self new test69_split
+    "
+
+    "Created: / 20-07-2018 / 23:54:15 / Claus Gittinger"
+!
+
 test70_storeString
 
     self assert: 'AAA' storeString = '''AAA'''.