7 func TestMyName(t *testing.T) {
8 if MyName() != "pstop" {
9 t.Errorf("MyName() expected to be %v but actually was %v", "pstop", MyName())
13 func Test_sec_to_time(t *testing.T) {
24 // add more values here
26 for i := range test_data {
27 if sec_to_time(test_data[i].input) != test_data[i].output {
28 t.Errorf("sec_to_time(%v) expected to be %v but actually was %v", test_data[i].input, test_data[i].output, sec_to_time(test_data[i].input))
33 func TestFormatTime(t *testing.T) {
42 {1000000, " 1.00 us"},
43 {1000000000, " 1.00 ms"},
44 {1000000000000, " 1.00 s"},
45 // add more values here
47 for i := range test_data {
48 if FormatTime(test_data[i].input) != test_data[i].output {
49 t.Errorf("FormatTime(%v) expected to be %v but actually was %v", test_data[i].input, test_data[i].output, FormatTime(test_data[i].input))