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

Function Test_missingNumber

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

Source from the content-addressed store, hash-verified

6)
7
8func Test_missingNumber(t *testing.T) {
9 type args struct {
10 nums []int
11 }
12 tests := []struct {
13 name string
14 args args
15 want int
16 }{
17 {
18 name: "missing number",
19 args: args{
20 nums: []int{
21 3, 0, 1,
22 },
23 },
24 want: 2,
25 },
26 {
27 name: "missing number",
28 args: args{
29 nums: []int{
30 9, 6, 4, 2, 3, 5, 7, 0, 1,
31 },
32 },
33 want: 8,
34 },
35 }
36 for _, tt := range tests {
37 t.Run(tt.name, func(t *testing.T) {
38 assert.Equal(t, tt.want, missingNumber(tt.args.nums))
39 })
40 }
41}

Callers

nothing calls this directly

Calls 1

missingNumberFunction · 0.85

Tested by

no test coverage detected