MCPcopy Create free account
hub / github.com/austingebauer/go-leetcode / Test_maxArea

Function Test_maxArea

container_with_most_water_11/solution_test.go:8–50  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

6)
7
8func Test_maxArea(t *testing.T) {
9 type args struct {
10 height []int
11 }
12 tests := []struct {
13 name string
14 args args
15 want int
16 }{
17 {
18 name: "container with most water",
19 args: args{
20 height: []int{
21 1, 8, 6, 2, 5, 4, 8, 3, 7,
22 },
23 },
24 want: 49,
25 },
26 {
27 name: "container with most water",
28 args: args{
29 height: []int{
30 1, 1,
31 },
32 },
33 want: 1,
34 },
35 {
36 name: "container with most water",
37 args: args{
38 height: []int{
39 1, 2, 4, 3,
40 },
41 },
42 want: 4,
43 },
44 }
45 for _, tt := range tests {
46 t.Run(tt.name, func(t *testing.T) {
47 assert.Equal(t, tt.want, maxArea(tt.args.height))
48 })
49 }
50}

Callers

nothing calls this directly

Calls 1

maxAreaFunction · 0.85

Tested by

no test coverage detected