]> git.giacomolli.uk - onechat/blob - schedule_helper_test.go
Check error handling and common Go mistakes
[onechat] / schedule_helper_test.go
1 package main
2
3 import (
4 "path/filepath"
5 "testing"
6 "time"
7
8 "github.com/stretchr/testify/require"
9 )
10
11 // newTestSchedules opens the schedules of a new file with clock.
12 func newTestSchedules(t *testing.T, clock func() time.Time) *Schedules {
13 t.Helper()
14
15 schedules, err := openSchedules(filepath.Join(t.TempDir(), scheduleFileName), clock, discardLog())
16 require.NoError(t, err)
17
18 return schedules
19 }