Skip to content

Commit 76c0ba7

Browse files
petertsengkotp
authored andcommitted
word-search: Add cases checking for concatenation and wrapping
The author of this commit thinks that concatenation is highly unlikely, but the wrapping might be useful to check in languages that allow negative indices.
1 parent 37f7831 commit 76c0ba7

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

exercises/word-search/canonical-data.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,61 @@
10241024
"abf": null,
10251025
"cbd": null
10261026
}
1027+
},
1028+
{
1029+
"uuid": "5b6198eb-2847-4e2f-8efe-65045df16bd3",
1030+
"description": "Should not concatenate different lines to find a horizontal word",
1031+
"property": "search",
1032+
"input": {
1033+
"grid": [
1034+
"abceli",
1035+
"xirdfg"
1036+
],
1037+
"wordsToSearchFor": [
1038+
"elixir"
1039+
]
1040+
},
1041+
"expected": {
1042+
"elixir": null
1043+
}
1044+
},
1045+
{
1046+
"uuid": "eba44139-a34f-4a92-98e1-bd5f259e5769",
1047+
"description": "Should not wrap around horizontally to find a word",
1048+
"property": "search",
1049+
"input": {
1050+
"grid": [
1051+
"silabcdefp"
1052+
],
1053+
"wordsToSearchFor": [
1054+
"lisp"
1055+
]
1056+
},
1057+
"expected": {
1058+
"lisp": null
1059+
}
1060+
},
1061+
{
1062+
"uuid": "cd1f0fa8-76af-4167-b105-935f78364dac",
1063+
"description": "Should not wrap around vertically to find a word",
1064+
"property": "search",
1065+
"input": {
1066+
"grid": [
1067+
"s",
1068+
"u",
1069+
"r",
1070+
"a",
1071+
"b",
1072+
"c",
1073+
"t"
1074+
],
1075+
"wordsToSearchFor": [
1076+
"rust"
1077+
]
1078+
},
1079+
"expected": {
1080+
"rust": null
1081+
}
10271082
}
10281083
]
10291084
}

0 commit comments

Comments
 (0)