Skip to content

Commit d8588f9

Browse files
Add tests for Project euler problem 14 solution (TheAlgorithms#1713)
* 📦 NEW: Added solution for ProjectEuler-007 * 🐛 FIX: Spelling mistake fixes * 👌 IMPROVE: changed variable name from `inc` to `candidateValue` and thrown error in case of invalid input * 👌 IMPROVE: Modified the code * 👌 IMPROVE: Added test case for ProjectEuler Problem001 * 👌 IMPROVE: Added test cases for Project Euler Problem 4 * 👌 IMPROVE: auto prettier fixes * 📦 NEW: Testcases for Project Euler Problem 14 * Updated Documentation in README.md * 👌 IMPROVE: code improvements --------- Co-authored-by: Omkarnath Parida <omkarnath.parida@yocket.in> Co-authored-by: pomkarnath98 <pomkarnath98@users.noreply.github.com>
1 parent 55ff0ad commit d8588f9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Project-Euler/test/Problem014.test.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { expect } from 'vitest'
2+
import { findLongestCollatzSequence } from '../Problem014.js'
3+
4+
describe('Longest Collatz Sequence', () => {
5+
test.each([
6+
[2, 1],
7+
[13, 9],
8+
[1000000, 837799]
9+
])(
10+
'if limit is %i, then the Longest Collatz Sequence will be %i',
11+
(a, expected) => {
12+
expect(findLongestCollatzSequence(a)).toBe(expected)
13+
}
14+
)
15+
})

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy