test: rename method for clarity

This commit is contained in:
Antoine Aflalo
2024-08-27 10:27:13 -04:00
parent 86923862a9
commit c57811fab1

View File

@@ -17,15 +17,15 @@ func TestConvertChapter(t *testing.T) {
}{ }{
{ {
name: "All split pages", name: "All split pages",
genTestChapter: loadTestChapterSplit, genTestChapter: genBigPages,
}, },
{ {
name: "No split pages", name: "No split pages",
genTestChapter: loadTestChapterNoSplit, genTestChapter: genSmallPages,
}, },
{ {
name: "Mix of split and no split pages", name: "Mix of split and no split pages",
genTestChapter: loadTestChapterMixSplit, genTestChapter: genMixSmallBig,
}, },
} }
// Load test genTestChapter from testdata // Load test genTestChapter from testdata
@@ -74,7 +74,7 @@ func TestConvertChapter(t *testing.T) {
} }
} }
func loadTestChapterSplit(path string) (*packer.Chapter, error) { func genBigPages(path string) (*packer.Chapter, error) {
file, err := os.Open(path) file, err := os.Open(path)
if err != nil { if err != nil {
return nil, err return nil, err
@@ -103,7 +103,7 @@ func loadTestChapterSplit(path string) (*packer.Chapter, error) {
}, nil }, nil
} }
func loadTestChapterNoSplit(path string) (*packer.Chapter, error) { func genSmallPages(path string) (*packer.Chapter, error) {
file, err := os.Open(path) file, err := os.Open(path)
if err != nil { if err != nil {
return nil, err return nil, err
@@ -132,7 +132,7 @@ func loadTestChapterNoSplit(path string) (*packer.Chapter, error) {
}, nil }, nil
} }
func loadTestChapterMixSplit(path string) (*packer.Chapter, error) { func genMixSmallBig(path string) (*packer.Chapter, error) {
file, err := os.Open(path) file, err := os.Open(path)
if err != nil { if err != nil {
return nil, err return nil, err