Skip to content

Commit

Permalink
all: deal with t.Run
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Feb 9, 2021
1 parent 484f477 commit 31cc29a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion internal/stats/stats_test.go
Expand Up @@ -148,7 +148,7 @@ func TestStatsCollector(t *testing.T) {

t.Run("hours", func(t *testing.T) {
statsData := statsCollector(units, 0, Hours, ng)
require.Len(t, statsData, 720)
assert.Len(t, statsData, 720)
})

t.Run("days", func(t *testing.T) {
Expand Down
6 changes: 4 additions & 2 deletions internal/sysutil/net_linux_test.go
Expand Up @@ -113,7 +113,9 @@ func TestSetStaticIPdhcpcdConf(t *testing.T) {
}}

for _, tc := range testCases {
s := updateStaticIPdhcpcdConf("wlan0", "192.168.0.2/24", tc.routers, net.IP{192, 168, 0, 2})
assert.Equal(t, tc.dhcpcdConf, s)
t.Run(tc.name, func(t *testing.T) {
s := updateStaticIPdhcpcdConf("wlan0", "192.168.0.2/24", tc.routers, net.IP{192, 168, 0, 2})
assert.Equal(t, tc.dhcpcdConf, s)
})
}
}
6 changes: 2 additions & 4 deletions internal/util/autohosts_test.go
Expand Up @@ -114,10 +114,8 @@ func TestAutoHostsFSNotify(t *testing.T) {
ah.Start()
t.Cleanup(ah.Close)

t.Run("file_update", func(t *testing.T) {
assertWriting(t, f, "127.0.0.2 newhost\n")
assert.Nil(t, f.Sync())
})
assertWriting(t, f, "127.0.0.2 newhost\n")
require.Nil(t, f.Sync())

// Wait until fsnotify has triggerred and processed the
// file-modification event.
Expand Down

0 comments on commit 31cc29a

Please sign in to comment.