Skip to content

Commit 66232e9

Browse files
committed
Finish off tests
1 parent 3b40abb commit 66232e9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

blaster/blaster_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,24 @@ import (
2424
"github.com/pkg/errors"
2525
)
2626

27+
func TestMetricsSegmentDuration(t *testing.T) {
28+
m := &metricsSegment{
29+
start: time.Date(2017, 1, 1, 1, 1, 1, 1, time.UTC),
30+
end: time.Date(2017, 1, 1, 1, 1, 2, 1, time.UTC),
31+
}
32+
if m.duration() != time.Second {
33+
t.Fatalf("Unexpected: %v", m.duration())
34+
}
35+
}
36+
37+
func TestRenderMapNotMap(t *testing.T) {
38+
r, _ := parseRenderer("")
39+
_, err := renderMap(r, nil)
40+
if err.Error() != "rendered template not a map" {
41+
t.Fatalf("Unexpected: %v", err)
42+
}
43+
}
44+
2745
func TestPrintStatus(t *testing.T) {
2846

2947
ctx, cancel := context.WithCancel(context.Background())

0 commit comments

Comments
 (0)