-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtask_test.go
21 lines (18 loc) · 882 Bytes
/
task_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package main
import (
"fmt"
"testing"
)
func TestParseProgress(t *testing.T) {
TestInput := []string{
" 80.00 KiB / 4.44 MiB [==>-------------------------------------------------------------------------------------------------------------------------------] 1.76% 139.10 KiB/s 00m31s",
" 0 B / 4.44 MiB [------------------------------------------------------------------------------------------------------------------------------------------------------------] 0.00%",
" 4.31 MiB / 4.44 MiB [========================================================================================================================================>---] 97.20% 3.58 MiB/s",
"Merging video parts into Nature Beautiful short video 720p HD.mp4",
}
for _, input := range TestInput {
task := &Task{rawProgress: input}
task.ParseProgress()
fmt.Printf("%+v\n", task.Progress)
}
}