Skip to content

Commit

Permalink
Add/Has short English words test.
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-kulcsar committed Jul 1, 2024
1 parent 2346b3f commit f5abe3d
Show file tree
Hide file tree
Showing 3 changed files with 1,018 additions and 1 deletion.
14 changes: 14 additions & 0 deletions add-has.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,20 @@ namespace AddHasTests {

}

// addAll() from short English list.
test = new TernaryStringSet()
test.addAll(ShortEnglishList.words)
if (test.size != ShortEnglishList.words.length) {
game.splash("Add/Has test 11a failed.")
allPassed = false
}
ShortEnglishList.words.forEach((s: string) => {
if (!test.has(s)) {
game.splash(`Add/Has test 11b failed for word ${s}.`)
allPassed = false
}
})

return allPassed
}
}
3 changes: 2 additions & 1 deletion pxt.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"main.ts",
"constructor.ts",
"add-has.ts",
"clear.ts"
"clear.ts",
"short-english-list.ts"
],
"testDependencies": {},
"targetVersions": {
Expand Down
Loading

0 comments on commit f5abe3d

Please sign in to comment.