MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / TestUniquePaths

Function TestUniquePaths

dynamic/uniquepaths_test.go:7–28  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

5)
6
7func TestUniquePaths(t *testing.T) {
8 testCases := map[string]struct {
9 m int
10 n int
11 want int
12 }{
13 "negative sizes": {-1, -1, 0},
14 "empty matrix both dimensions": {0, 0, 0},
15 "empty matrix one dimension": {0, 1, 0},
16 "one element": {1, 1, 1},
17 "small matrix": {2, 2, 2},
18 "stress test": {1000, 1000, 2874513998398909184},
19 }
20
21 for name, test := range testCases {
22 t.Run(name, func(t *testing.T) {
23 if got := UniquePaths(test.m, test.n); got != test.want {
24 t.Errorf("UniquePaths(%v, %v) = %v, want %v", test.m, test.n, got, test.want)
25 }
26 })
27 }
28}

Callers

nothing calls this directly

Calls 1

UniquePathsFunction · 0.85

Tested by

no test coverage detected