Skip to content

Commit

Permalink
Add template to perform unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nakabonne committed Nov 1, 2020
1 parent bce8acf commit abb23fe
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ require (
github.com/shirou/gopsutil v2.20.9+incompatible
github.com/sirupsen/logrus v1.7.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.6.1 // indirect
github.com/stretchr/testify v1.6.1
)
24 changes: 24 additions & 0 deletions stats/meta_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package stats

import (
"testing"

"github.com/stretchr/testify/assert"
)

func TestNewMeta(t *testing.T) {
tests := []struct {
name string
want *Meta
wantErr bool
}{
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := NewMeta()
assert.Equal(t, tt.wantErr, err != nil)
assert.Equal(t, tt.want, got)
})
}
}
24 changes: 24 additions & 0 deletions stats/stats_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package stats

import (
"testing"

"github.com/stretchr/testify/assert"
)

func TestNewStats(t *testing.T) {
tests := []struct {
name string
want *Stats
wantErr bool
}{
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := NewStats()
assert.Equal(t, tt.wantErr, err != nil)
assert.Equal(t, tt.want, got)
})
}
}

0 comments on commit abb23fe

Please sign in to comment.