RegressionTests__JavaScriptTestClass.st
author Claus Gittinger <cg@exept.de>
Tue, 28 Aug 2018 13:04:41 +0200
changeset 2004 3b06c74f24b7
parent 2003 710ddabaec76
child 2005 4c96619d8445
permissions -rw-r--r--
#QUALITY by cg class: RegressionTests::JavaScriptTestClass added: #testMap8

public class RegressionTests::JavaScriptTestClass extends Object
{
}


/** category: testing **/

/**
    (new JavaScriptTestClass).testMap1()
 **/
function testMap1() {
    return [1,2,3].map( el => el ** 2 );
}

/** category: testing **/

/**
    (new JavaScriptTestClass).testMap2()
 **/
function testMap2() {
    return [1,2,3].map( (el) => el ** 2 );
}

/** category: testing **/

/**
    (new JavaScriptTestClass).testMap3()
 **/
function testMap3() {
    return [1,2,3].map( (el) => { return el ** 2; } );
}

/** category: testing **/

/**
    (new JavaScriptTestClass).testMap4()
 **/
function testMap4() {
    function f(el) { return el ** 2; };
    
    return [1,2,3].map( f );
}

/** category: testing **/

/**
    (new JavaScriptTestClass).testMap5()
 **/
function testMap5() {
    function f(el) { 
        return el ** 2; 
    }
    
    return [1,2,3].map( f );
}

/** category: testing **/

/**
    (new JavaScriptTestClass).testMap6()
 **/
function testMap6() {
    var f = function (el) { return el ** 2; };
    
    return [1,2,3].map( f );
}

/** category: testing **/

/**
    (new JavaScriptTestClass).testMap7()
 **/
function testMap7() {
    var f = el => el ** 2;
    
    return [1,2,3].map( f );
}

/** category: testing **/

/**
    (new JavaScriptTestClass).testMap8()
 **/
function testMap8() {
    var f = (el => el ** 2);
    
    return [1,2,3].map( f );
}


/** category: documentation **/

static function version_CVS() {
    return("$Header$");
}