(t *testing.T)
| 110 | } |
| 111 | |
| 112 | func TestDuration_IsZero(t *testing.T) { |
| 113 | tests := []struct { |
| 114 | name string |
| 115 | val time.Duration |
| 116 | want bool |
| 117 | }{ |
| 118 | {">0", 1, false}, |
| 119 | {"<0", -1, false}, |
| 120 | {"=0", 0, true}, |
| 121 | } |
| 122 | for _, tt := range tests { |
| 123 | t.Run(tt.name, func(t *testing.T) { |
| 124 | t.Parallel() |
| 125 | d := Duration{tt.val} |
| 126 | if got := d.IsZero(); got != tt.want { |
| 127 | t.Errorf("IsZero() = %v, want %v", got, tt.want) |
| 128 | } |
| 129 | }) |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | func TestDuration_UnmarshalText(t *testing.T) { |
| 134 | var d Duration |