#QUALITY by cg
authorClaus Gittinger <cg@exept.de>
Tue, 24 Apr 2018 07:34:00 +0200
changeset 1908 01dc41611b51
parent 1907 d859a53afc52
child 1909 bcc178fa82a7
#QUALITY by cg class: RegressionTests::JavaScriptTests added: #testOperators02b_plusString #testOperators04b_plusString #testOperators29b_plusAssignString
RegressionTests__JavaScriptTests.st
--- a/RegressionTests__JavaScriptTests.st	Mon Apr 23 22:18:46 2018 +0200
+++ b/RegressionTests__JavaScriptTests.st	Tue Apr 24 07:34:00 2018 +0200
@@ -1762,6 +1762,21 @@
     "
 !
 
+testOperators02b_plusString
+    self
+        execute:'expr(a, b) {
+                    return (a + "world");
+                 }'
+        for:nil
+        arguments:#('hello' 'world')
+        expect:'helloworld'
+
+    "
+     self run:#testOperators02b_plusString
+     self new testOperators02b_plusString
+    "
+!
+
 testOperators03_minus
     self
 	execute:'expr(a, b) {
@@ -1792,6 +1807,21 @@
     "
 !
 
+testOperators04b_plusString
+    self
+        execute:'expr(a, b) {
+                    return (a + a);
+                 }'
+        for:nil
+        arguments:#('abc' 'abc')
+        expect:'abcabc'
+
+    "
+     self run:#testOperators04b_plusString
+     self new testOperators04b_plusString
+    "
+!
+
 testOperators05_mul
     self
 	execute:'expr(a, b) {
@@ -2743,6 +2773,26 @@
     "
 !
 
+testOperators29b_plusAssignString
+    self
+        execute:'expr(a, b, c, d) {
+                    var s = "hello";
+                    s += a;
+                    s += b;
+                    s += c;
+                    s += d;
+                    return (s);
+                 }'
+        for:nil
+        arguments:#( 'w' 'o' 'r' 'ld')
+        expect:'helloworld'
+
+    "
+     self run:#testOperators29b_plusAssignString
+     self new testOperators29b_plusAssignString
+    "
+!
+
 testOperators29c_minusAssign
     self
 	execute:'expr(a, b, c, d) {