GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — merge: Add test case to Fibonacci Search Algorithm (#1042) · Algorithms-Learn/JavaScript@f5be6b2

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Search/test
    • FibonacciSearch.test.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Search/test/FibonacciSearch.test.js‎

Copy file name to clipboard
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { fibonacciSearch } from '../FibonacciSearch'
2+
3+
test('fibonacciSearch([10, 22, 35, 40, 45, 50, 80, 82, 85, 90, 100], 90, arr.length) => 9', () => {
4+
const arr = [10, 22, 35, 40, 45, 50, 80, 82, 85, 90, 100]
5+
const target = 90
6+
const res = fibonacciSearch(arr, target, arr.length)
7+
expect(res).toEqual(9)
8+
})
9+
10+
test('fibonacciSearch([1, 11, 55, 56, 78, 82, 104], 104, arr.length) => 6', () => {
11+
const arr = [1, 11, 55, 56, 78, 82, 104]
12+
const target = 104
13+
const res = fibonacciSearch(arr, target, arr.length)
14+
expect(res).toEqual(6)
15+
})
16+
17+
test('fibonacciSearch([40, 45, 50, 80, 82, 85, 90, 100]. 190, arr.length) => -1', () => {
18+
const arr = [40, 45, 50, 80, 82, 85, 90, 100]
19+
const target = 190
20+
const res = fibonacciSearch(arr, target, arr.length)
21+
expect(res).toEqual(-1)
22+
})

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.