Skip to content

Commit 5f143d9

Browse files
committed
tests: add tests checking if floodFill funtions throw when location is outside
1 parent bd34e9f commit 5f143d9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Diff for: Recursive/test/FloodFill.test.js

+13
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ describe('FloodFill', () => {
2121
})
2222
})
2323

24+
describe.each([breadthFirstSearch, depthFirstSearch])('%o', (floodFillFun) => {
25+
it.each([
26+
[1, -1],
27+
[-1, 1],
28+
[0, 7],
29+
[7, 0]
30+
])('throws for start position [%i, %i]', (location) => {
31+
expect(() =>
32+
floodFillFun(generateTestRgbData(), location, green, orange)
33+
).toThrowError()
34+
})
35+
})
36+
2437
/**
2538
* Utility-function to test the function "breadthFirstSearch".
2639
*

0 commit comments

Comments
 (0)