--- a/RegressionTests__JavaScriptTests.st Wed Apr 27 15:47:52 2005 +0200
+++ b/RegressionTests__JavaScriptTests.st Wed Apr 27 16:22:05 2005 +0200
@@ -162,6 +162,92 @@
"
!
+testArray04
+ self
+ execute:'test() {
+ var arr = new Array;
+ return arr;
+ }'
+ for:nil
+ arguments:#( )
+ expect:#( )
+
+ "
+ self run:#testArray04
+ self new testArray04
+ "
+!
+
+testArray05
+ self
+ execute:'test() {
+ var arr = new Array();
+ return arr;
+ }'
+ for:nil
+ arguments:#( )
+ expect:#( )
+
+ "
+ self run:#testArray05
+ self new testArray05
+ "
+!
+
+testArray06
+ self
+ execute:'test() {
+ var arr = new Array(5);
+ return arr;
+ }'
+ for:nil
+ arguments:#( )
+ expect:#( nil nil nil nil nil )
+
+ "
+ self run:#testArray06
+ self new testArray06
+ "
+!
+
+testArray07
+ self
+ execute:'test() {
+ var arr = new Array(3);
+ arr[1] = 41;
+ arr[2] = -5;
+ arr[3] = 20;
+ return arr;
+ }'
+ for:nil
+ arguments:#( )
+ expect:#( 41 -5 20 )
+
+ "
+ self run:#testArray07
+ self new testArray07
+ "
+!
+
+testArray08
+ self
+ execute:'test() {
+ var arr = new Array(3);
+ arr[1] = 41;
+ arr[2] = -5;
+ arr[3] = 20;
+ return arr;
+ }'
+ for:nil
+ arguments:#( )
+ expect:#( 41 -5 20 )
+
+ "
+ self run:#testArray08
+ self new testArray08
+ "
+!
+
testConditionalExpression01
self
execute:'max(a, b) {
@@ -322,6 +408,22 @@
"
!
+testException01
+ self
+ execute:'test(arr) {
+ try {
+ } catch
+ }'
+ for:nil
+ arguments:#( #(10 20 30) )
+ expect:10
+
+ "
+ self run:#testArray01
+ self new testArray01
+ "
+!
+
testFor01
self
execute:'test(arg) {
@@ -2932,7 +3034,16 @@
|spec|
spec := #(
+ ('"\x00"' #isString (#eval '(Character value:0) asString') )
('"\x01"' #isString (#eval '(Character value:1) asString') )
+ ('"\x1a"' #isString (#eval '(Character value:16r1a) asString') )
+ ('"\x000"' #isString (#eval '(Character value:0) asString , ''0'' ') )
+ ('"\xgg"' #isString (#error ) )
+ ('"\xg"' #isString (#error ) )
+ ('"\x"' #isString (#error ) )
+ ('"\x0g"' #isString (#error ) )
+ ('"\u1234"' #isString (#eval '(Character value:16r1234) asString ') )
+ ('"\uFFFF"' #isString (#eval '(Character value:16rFFFF) asString ') )
).
self doTestEachFromSpec:spec.