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 shellSort algorithm (#975) · Algorithms-Learn/JavaScript@2169e17

File tree

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

‎Sorts/test/ShellSort.test.js‎

Copy file name to clipboard
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { shellSort } from '../ShellSort'
2+
3+
test('The ShellSort of the array [5, 4, 3, 2, 1] is [1, 2, 3, 4, 5]', () => {
4+
const arr = [5, 4, 3, 2, 1]
5+
const res = shellSort(arr)
6+
expect(res).toEqual([1, 2, 3, 4, 5])
7+
})
8+
9+
test('The ShellSort of the array [] is []', () => {
10+
const arr = []
11+
const res = shellSort(arr)
12+
expect(res).toEqual([])
13+
})
14+
15+
test('The ShellSort of the array [15, 24, 31, 42, 11] is [11, 15, 24, 31, 42]', () => {
16+
const arr = [15, 24, 31, 42, 11]
17+
const res = shellSort(arr)
18+
expect(res).toEqual([11, 15, 24, 31, 42])
19+
})
20+
21+
test('The ShellSort of the array [121, 190, 169] is [121, 169, 190]', () => {
22+
const arr = [121, 190, 169]
23+
const res = shellSort(arr)
24+
expect(res).toEqual([121, 169, 190])
25+
})

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.