Commented out image writer tests cuz i gotta think

of a good way to do them :)
This commit is contained in:
Karma Riuk 2023-08-11 14:31:51 +02:00
parent c6aca1e6d6
commit 648e4c15fc

View File

@ -9,67 +9,67 @@ import (
) )
func TestImageWriter(t *testing.T) { func TestImageWriter(t *testing.T) {
pathGradient, err := colorgrad.NewGradient().Colors(color.White).Build() // pathGradient, err := colorgrad.NewGradient().Colors(color.White).Build()
if err != nil { // if err != nil {
panic(err) // panic(err)
} // }
//
tests := []struct { // tests := []struct {
name string // name string
filename string // filename string
m *maze.SolvedMaze // m *maze.SolvedMaze
CellWidth, cellHeight int // CellWidth, cellHeight int
pathColor, wallColor color.Color // pathColor, wallColor color.Color
gradient colorgrad.Gradient // gradient colorgrad.Gradient
}{ // }{
{ // {
"Trivial", // "Trivial",
"../../out/trivial_sol.png", // "../../out/trivial_sol.png",
trivial(), // trivial(),
40, 40, // 40, 40,
color.White, color.Black, // color.White, color.Black,
colorgrad.Warm(), // colorgrad.Warm(),
}, // },
{ // {
"Bigger", // "Bigger",
"../../out/bigger_sol.png", // "../../out/bigger_sol.png",
bigger(), // bigger(),
40, 40, // 40, 40,
color.White, color.Black, // color.White, color.Black,
colorgrad.Warm(), // colorgrad.Warm(),
}, // },
{ // {
"Bigger Staggered", // "Bigger Staggered",
"../../out/bigger_staggered_sol.png", // "../../out/bigger_staggered_sol.png",
bigger_staggered(), // bigger_staggered(),
40, 40, // 40, 40,
color.White, color.Black, // color.White, color.Black,
pathGradient, // pathGradient,
}, // },
{ // {
"Normal", // "Normal",
"../../out/normal_sol.png", // "../../out/normal_sol.png",
normal(), // normal(),
40, 40, // 40, 40,
color.White, color.Black, // color.White, color.Black,
colorgrad.Warm(), // colorgrad.Warm(),
}, // },
} // }
//
for _, test := range tests { // for _, test := range tests {
writer := ImageWriter{ // writer := ImageWriter{
Filename: test.filename, // Filename: test.filename,
Maze: test.m, // Maze: test.m,
CellWidth: test.CellWidth, // CellWidth: test.CellWidth,
CellHeight: test.cellHeight, // CellHeight: test.cellHeight,
WallColor: test.wallColor, // WallColor: test.wallColor,
PathColor: test.pathColor, // PathColor: test.pathColor,
SolutionGradient: test.gradient, // SolutionGradient: test.gradient,
} // }
//
err := writer.Write() // err := writer.Write()
if err != nil { // if err != nil {
t.Fatalf("%s: couldn't write solution, got following error\n%v", test.name, err) // t.Fatalf("%s: couldn't write solution, got following error\n%v", test.name, err)
} // }
} // }
} }