Fix shopping list tests.

pull/5787/head
HoBi 2016-01-02 23:55:04 +01:00 committed by Honza Bittner
parent 97cdc71772
commit 5f8406d350
1 changed files with 18 additions and 11 deletions

View File

@ -1744,23 +1744,30 @@
],
"tail": [
"var count = 0;",
"var isArray = true;",
"var hasString = true;",
"var hasNumber = true;",
"var isArray = false;",
"var hasString = false;",
"var hasNumber = false;",
"(function(list){",
" if(Array.isArray(myList)) {",
" myList.forEach(function(elem) {",
" if(typeof elem[0] !== 'string') {",
" hasString = false;",
" }",
" if(typeof elem[1] !== 'number') {",
" hasNumber = false;",
" }",
" });",
" isArray = true;",
" if(myList.length > 0) {",
" hasString = true;",
" hasNumber = true;",
" myList.forEach(function(elem) {",
" if(typeof elem[0] !== 'string') {",
" hasString = false;",
" }",
" if(typeof elem[1] !== 'number') {",
" hasNumber = false;",
" }",
" });",
" }",
" count = myList.length;",
" return JSON.stringify(myList);",
" } else {",
" isArray = false;",
" hasString = false;",
" hasNumber = false;",
" return \"myList is not an array\";",
" }",
"",