(t *testing.T)
| 35 | } |
| 36 | |
| 37 | func TestPrettifyDurationOutput(t *testing.T) { |
| 38 | type args struct { |
| 39 | d time.Duration |
| 40 | } |
| 41 | tests := []struct { |
| 42 | name string |
| 43 | args args |
| 44 | want string |
| 45 | }{ |
| 46 | {"ZeroNumber", args{0}, "0s"}, |
| 47 | {"negativeNum", args{-10}, "0s"}, |
| 48 | {"lessOneSecond", args{1011212}, "0s"}, |
| 49 | {"oneSecond", args{time.Second}, "1s"}, |
| 50 | {"oneMin", args{time.Minute}, "1m0s"}, |
| 51 | {"oneHour", args{time.Hour}, "1h0m0s"}, |
| 52 | {"1h17m6s", args{time.Hour*1 + time.Minute*17 + time.Second*6}, "1h17m6s"}, |
| 53 | } |
| 54 | for _, tt := range tests { |
| 55 | t.Run(tt.name, func(t *testing.T) { |
| 56 | if got := PrettifyDurationOutput(tt.args.d); got != tt.want { |
| 57 | t.Errorf("PrettifyDurationOutput() = %v, want %v", got, tt.want) |
| 58 | } |
| 59 | }) |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | //var userAndPwd = "root:pass" |
| 64 | //var testAddr = "127.0.0.1:33061" |
nothing calls this directly
no test coverage detected