(t *testing.T)
| 23 | const testFile = "test.out" |
| 24 | |
| 25 | func TestUptimeFromFileSuccess(t *testing.T) { |
| 26 | d1 := []byte("350735.47 234388.90") |
| 27 | err := os.WriteFile(testFile, d1, 0644) |
| 28 | h.Ok(t, err) |
| 29 | |
| 30 | value, err := UptimeFromFile(testFile) |
| 31 | _ = os.Remove(testFile) |
| 32 | h.Ok(t, err) |
| 33 | h.Equals(t, int64(350735), value) |
| 34 | } |
| 35 | |
| 36 | func TestUptimeFromFileReadFail(t *testing.T) { |
| 37 | _, err := UptimeFromFile("does-not-exist") |
nothing calls this directly
no test coverage detected