mirror of
https://github.com/Belphemur/CBZOptimizer.git
synced 2025-10-14 12:38:50 +02:00
test: improve the test to work with multiple converter in the future
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
package webp
|
package converter
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
@@ -35,6 +35,12 @@ func TestConvertChapter(t *testing.T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
defer os.Remove(temp.Name())
|
defer os.Remove(temp.Name())
|
||||||
|
for _, converter := range Available() {
|
||||||
|
converter, err := Get(converter)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to get converter: %v", err)
|
||||||
|
}
|
||||||
|
t.Run(converter.Format().String(), func(t *testing.T) {
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
t.Run(tc.name, func(t *testing.T) {
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
chapter, err := tc.genTestChapter(temp.Name())
|
chapter, err := tc.genTestChapter(temp.Name())
|
||||||
@@ -42,7 +48,6 @@ func TestConvertChapter(t *testing.T) {
|
|||||||
t.Fatalf("failed to load test genTestChapter: %v", err)
|
t.Fatalf("failed to load test genTestChapter: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
converter := New()
|
|
||||||
quality := uint8(80)
|
quality := uint8(80)
|
||||||
|
|
||||||
progress := func(msg string) {
|
progress := func(msg string) {
|
||||||
@@ -65,6 +70,8 @@ func TestConvertChapter(t *testing.T) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func loadTestChapterSplit(path string) (*packer.Chapter, error) {
|
func loadTestChapterSplit(path string) (*packer.Chapter, error) {
|
Reference in New Issue
Block a user