diff options
| author | Taras Madan <tarasmadan@google.com> | 2024-10-02 09:55:21 +0200 |
|---|---|---|
| committer | Taras Madan <tarasmadan@google.com> | 2024-10-02 09:40:02 +0000 |
| commit | e13d0f0baaeea41cc584c6333bbf0b788d7174b9 (patch) | |
| tree | 586aeb0aa62c81705ae8158814c152417e7c1a52 /pkg/cover/heatmap_test.go | |
| parent | ea2b66a65b01cd61336424457391310e8dd8b62b (diff) | |
pkg/cover: use timePeriods instead of civil.Date
Diffstat (limited to 'pkg/cover/heatmap_test.go')
| -rw-r--r-- | pkg/cover/heatmap_test.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pkg/cover/heatmap_test.go b/pkg/cover/heatmap_test.go index f83b31191..be90493df 100644 --- a/pkg/cover/heatmap_test.go +++ b/pkg/cover/heatmap_test.go @@ -8,6 +8,7 @@ import ( "time" "cloud.google.com/go/civil" + "github.com/google/syzkaller/pkg/coveragedb" "github.com/stretchr/testify/assert" ) @@ -33,7 +34,7 @@ func TestFilesCoverageToTemplateData(t *testing.T) { Filepath: "file1", Instrumented: 1, Covered: 1, - Dateto: civil.Date{Year: 2024, Month: time.July, Day: 1}, + TimePeriod: coveragedb.TimePeriod{DateTo: civil.Date{Year: 2024, Month: time.July, Day: 1}, Days: 1}, }, }, want: &templateHeatmap{ @@ -60,7 +61,7 @@ func TestFilesCoverageToTemplateData(t *testing.T) { "Instrumented:\t1 blocks\nCovered:\t1 blocks", }, }, - Dates: []string{"2024-07-01"}, + Periods: []string{"2024-07-01(1)"}, }, }, { @@ -70,13 +71,13 @@ func TestFilesCoverageToTemplateData(t *testing.T) { Filepath: "dir/file2", Instrumented: 1, Covered: 0, - Dateto: civil.Date{Year: 2024, Month: time.July, Day: 2}, + TimePeriod: coveragedb.TimePeriod{DateTo: civil.Date{Year: 2024, Month: time.July, Day: 2}, Days: 1}, }, { Filepath: "dir/file1", Instrumented: 1, Covered: 1, - Dateto: civil.Date{Year: 2024, Month: time.July, Day: 1}, + TimePeriod: coveragedb.TimePeriod{DateTo: civil.Date{Year: 2024, Month: time.July, Day: 1}, Days: 1}, }, }, want: &templateHeatmap{ @@ -128,7 +129,7 @@ func TestFilesCoverageToTemplateData(t *testing.T) { "Instrumented:\t1 blocks\nCovered:\t0 blocks", }, }, - Dates: []string{"2024-07-01", "2024-07-02"}, + Periods: []string{"2024-07-01(1)", "2024-07-02(1)"}, }, }, } |
