RegressionTests__JavaScriptTestClass.st
changeset 2001 6fa077edd661
child 2002 721352c71cac
equal deleted inserted replaced
2000:100446cafd52 2001:6fa077edd661
       
     1 public class RegressionTests::JavaScriptTestClass extends Object
       
     2 {
       
     3 }
       
     4 
       
     5 
       
     6 /** category: testing **/
       
     7 
       
     8 /**
       
     9     (new JavaScriptTestClass).testMap1()
       
    10  **/
       
    11 function testMap1() {
       
    12     return [1,2,3].map( el => el ** 2 );
       
    13 }
       
    14 
       
    15 /** category: testing **/
       
    16 
       
    17 /**
       
    18     (new JavaScriptTestClass).testMap2()
       
    19  **/
       
    20 function testMap2() {
       
    21     return [1,2,3].map( (el) => el ** 2 );
       
    22 }
       
    23 
       
    24 /** category: testing **/
       
    25 
       
    26 /**
       
    27     (new JavaScriptTestClass).testMap3()
       
    28  **/
       
    29 function testMap3() {
       
    30     return [1,2,3].map( (el) => { return el ** 2; } );
       
    31 }
       
    32 
       
    33 /** category: testing **/
       
    34 
       
    35 /**
       
    36     (new JavaScriptTestClass).testMap4()
       
    37  **/
       
    38 function testMap4() {
       
    39     function f(el) { return el ** 2; };
       
    40     
       
    41     return [1,2,3].map( f );
       
    42 }
       
    43 
       
    44 /** category: testing **/
       
    45 
       
    46 /**
       
    47     (new JavaScriptTestClass).testMap5()
       
    48  **/
       
    49 function testMap5() {
       
    50     function f(el) { 
       
    51         return el ** 2; 
       
    52     }
       
    53     
       
    54     return [1,2,3].map( f );
       
    55 }
       
    56 
       
    57 
       
    58 /** category: documentation **/
       
    59 
       
    60 function version_CVS() {
       
    61     return("$Header$");
       
    62 }
       
    63