Fix shopping list tests.

This commit is contained in:
HoBi
2016-01-02 23:55:04 +01:00
committed by Honza Bittner
parent 97cdc71772
commit 5f8406d350

View File

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