TestViewReturnsTimeoutString verifies that View returns the timeout as a string.
(t *testing.T)
| 318 | |
| 319 | // TestViewReturnsTimeoutString verifies that View returns the timeout as a string. |
| 320 | func TestViewReturnsTimeoutString(t *testing.T) { |
| 321 | m := New(5*time.Second) |
| 322 | view := m.View() |
| 323 | |
| 324 | if view != "5s" { |
| 325 | t.Errorf("expected View to return '5s', got '%s'", view) |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | // TestRunningReturnsFalseWhenTimedOut verifies that Running() returns false |
| 330 | // when the timer has timed out. |