Skip to content

Commit 68c3592

Browse files
committed
test: add edge cases and mixed number types for LocalMaximomPoint
1 parent 1554ba5 commit 68c3592

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Data-Structures/Array/test/LocalMaximomPoint.test.js

+10
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,14 @@ describe('LocalMaximumPoint tests', () => {
2626
const Array2 = [13, 16, 5, 41, 3, 2, 1]
2727
expect(LocalMaximomPoint(Array2)).toEqual(3)
2828
})
29+
30+
it('test with positive and negative numbers', () => {
31+
const Array4 = [-4, -3, -2, -1, -5, 4, -1]
32+
expect(LocalMaximomPoint(Array4)).toEqual(3)
33+
})
34+
35+
it('test with floating-point numbers', () => {
36+
const Array5 = [1.5, 3.5, 2.5, 0.5, -1.5, -3.5, -2.5]
37+
expect(LocalMaximomPoint(Array5)).toEqual(1)
38+
})
2939
})

0 commit comments

Comments
 (0)