forked from seancribbs/erlyjs
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Array, String, arguments member operator stuff
- Loading branch information
1 parent
4137989
commit d39a2c3
Showing
7 changed files
with
178 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Mandatory. Return here a description of the test case. | ||
function test_description() { | ||
return "arguments"; | ||
} | ||
|
||
// Mandatory. Return here an array of arguments the testsuite will use | ||
// to invoke the test() function. For no arguments return an empty array. | ||
function test_args() { | ||
return []; | ||
} | ||
|
||
// Mandatory. Return here the expected test result. | ||
function test_ok() { | ||
return 3; | ||
} | ||
|
||
// Optional. Provide here any global code. | ||
|
||
|
||
// Mandatory. The actual test. | ||
// Testsuite invokes this function with the arguments from test_args() | ||
// and compares the return value with the expected result from test_ok(). | ||
function test() { | ||
function abc(a, b, c) { | ||
return arguments[2]; | ||
} | ||
return abc(1, 2, 3, 4, 5); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Mandatory. Return here a description of the test case. | ||
function test_description() { | ||
return "arguments"; | ||
} | ||
|
||
// Mandatory. Return here an array of arguments the testsuite will use | ||
// to invoke the test() function. For no arguments return an empty array. | ||
function test_args() { | ||
return []; | ||
} | ||
|
||
// Mandatory. Return here the expected test result. | ||
function test_ok() { | ||
return 5; | ||
} | ||
|
||
// Optional. Provide here any global code. | ||
|
||
|
||
// Mandatory. The actual test. | ||
// Testsuite invokes this function with the arguments from test_args() | ||
// and compares the return value with the expected result from test_ok(). | ||
function test() { | ||
function abc(a, b, c) { | ||
var b = arguments["4"]; | ||
return b; | ||
} | ||
return abc(1, 2, 3, 4, 5); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
// Mandatory. Provide here a description of the test case. | ||
function test_description() { | ||
return "Prediefined core object 'String', method: 'indexOf'"; | ||
return "Predefined core object 'String', method: 'indexOf'"; | ||
} | ||
|
||
// Mandatory. Provide here the arguments the testsuite will use | ||
// Mandatory. Provide here the arguments the testsuite will use | ||
// to invoke the test() function. | ||
function test_args() { | ||
return []; | ||
} | ||
|
||
// Mandatory. Provide here the expected test result. | ||
// Mandatory. Provide here the expected test result. | ||
function test_ok() { | ||
return 0; | ||
} | ||
|
||
// Optional. Provide here any global code. | ||
|
||
|
||
// Mandatory. The actual test. | ||
// Mandatory. The actual test. | ||
// Testsuite invokes this function with the arguments from test_args() | ||
// and compares the return value with the expected result from test_result(). | ||
function test() { | ||
function test() { | ||
var a = "Blue Whale"; | ||
return a.indexOf("Blue"); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Mandatory. Provide here a description of the test case. | ||
function test_description() { | ||
return "string index"; | ||
} | ||
|
||
// Mandatory. Provide here the arguments the testsuite will use | ||
// to invoke the test() function. | ||
function test_args() { | ||
return []; | ||
} | ||
|
||
// Mandatory. Provide here the expected test result. | ||
function test_ok() { | ||
return "F"; | ||
} | ||
|
||
// Optional. Provide here any global code. | ||
|
||
|
||
// Mandatory. The actual test. | ||
// Testsuite invokes this function with the arguments from test_args() | ||
// and compares the return value with the expected result from test_result(). | ||
function test() { | ||
var a = "Foo"; | ||
return a[0]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Mandatory. Provide here a description of the test case. | ||
function test_description() { | ||
return "string index"; | ||
} | ||
|
||
// Mandatory. Provide here the arguments the testsuite will use | ||
// to invoke the test() function. | ||
function test_args() { | ||
return []; | ||
} | ||
|
||
// Mandatory. Provide here the expected test result. | ||
function test_ok() { | ||
return "o"; | ||
} | ||
|
||
// Optional. Provide here any global code. | ||
|
||
|
||
// Mandatory. The actual test. | ||
// Testsuite invokes this function with the arguments from test_args() | ||
// and compares the return value with the expected result from test_result(). | ||
function test() { | ||
var a = "Foo", | ||
b = a[a.length - 1]; | ||
return b; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Mandatory. Provide here a description of the test case. | ||
function test_description() { | ||
return "string index"; | ||
} | ||
|
||
// Mandatory. Provide here the arguments the testsuite will use | ||
// to invoke the test() function. | ||
function test_args() { | ||
return []; | ||
} | ||
|
||
// Mandatory. Provide here the expected test result. | ||
function test_ok() { | ||
return "F"; | ||
} | ||
|
||
// Optional. Provide here any global code. | ||
|
||
|
||
// Mandatory. The actual test. | ||
// Testsuite invokes this function with the arguments from test_args() | ||
// and compares the return value with the expected result from test_result(). | ||
function test() { | ||
var a = "Foo", | ||
b = a["0"]; | ||
return b; | ||
} |