Skip to content

Commit ddeb040

Browse files
committed
tests: replace the tests for LocalMaximomPoint test
1 parent d13cccd commit ddeb040

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Diff for: Data-Structures/Array/test/LocalMaximomPoint.test.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ describe('LocalMaximumPoint tests', () => {
2626
expect(LocalMaximomPoint(Array2)).toEqual(3)
2727
})
2828

29-
it('test with positive and negative numbers', () => {
30-
const Array2 = [-4, -3, -2, -1, -5, 4, -1]
31-
expect(LocalMaximomPoint(Array2)).toEqual(3)
29+
it('test inner points - repeated local maxima', () => {
30+
const Array2 = [1, 5, 5, 5, 3, 2, 1]
31+
const result = LocalMaximomPoint(Array2)
32+
expect([1, 2, 3]).toContain(result)
3233
})
3334

34-
it('test with floating-point numbers', () => {
35-
const Array2 = [1.5, 3.5, 2.5, 0.5, -1.5, -3.5, -2.5]
36-
expect(LocalMaximomPoint(Array2)).toEqual(1)
35+
it('test inner points - alternating peaks and valleys', () => {
36+
const Array2 = [1, 3, 2, 4, 3, 5, 4]
37+
const result = LocalMaximomPoint(Array2)
38+
expect([1, 3, 5]).toContain(result)
3739
})
3840
})

0 commit comments

Comments
 (0)