Re-enabled text_test.go
This commit is contained in:
parent
b6dff509f9
commit
3d4a2b9bfb
@ -1,33 +1,31 @@
|
|||||||
package reader
|
package reader
|
||||||
|
|
||||||
import (
|
import (
|
||||||
// "maze-solver/maze"
|
"maze-solver/utils"
|
||||||
// "maze-solver/utils"
|
"reflect"
|
||||||
// "reflect"
|
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestTextReadTrivial(t *testing.T) {
|
func TestTextReadTrivial(t *testing.T) {
|
||||||
/*
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
filename string
|
filename string
|
||||||
pathChar byte
|
pathChar byte
|
||||||
wallChar byte
|
wallChar byte
|
||||||
expected *maze.RawMaze
|
expected *RawMaze
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"Trivial",
|
"Trivial",
|
||||||
"../../assets/trivial.txt",
|
"../../assets/trivial.txt",
|
||||||
' ',
|
' ',
|
||||||
'#',
|
'#',
|
||||||
&maze.RawMaze{
|
&RawMaze{
|
||||||
PathChar: ' ',
|
Width: 5,
|
||||||
WallChar: '#',
|
Height: 3,
|
||||||
Data: []string{
|
Data: [][]byte{
|
||||||
"## ##",
|
{0b_00100_000},
|
||||||
"# #",
|
{0b_01110_000},
|
||||||
"### #",
|
{0b_00010_000},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -36,15 +34,15 @@ func TestTextReadTrivial(t *testing.T) {
|
|||||||
"../../assets/trivial-bigger.txt",
|
"../../assets/trivial-bigger.txt",
|
||||||
' ',
|
' ',
|
||||||
'#',
|
'#',
|
||||||
&maze.RawMaze{
|
&RawMaze{
|
||||||
PathChar: ' ',
|
Width: 7,
|
||||||
WallChar: '#',
|
Height: 5,
|
||||||
Data: []string{
|
Data: [][]byte{
|
||||||
"### ###",
|
{0b_0001000_0},
|
||||||
"### ###",
|
{0b_0001000_0},
|
||||||
"# #",
|
{0b_0111110_0},
|
||||||
"##### #",
|
{0b_0000010_0},
|
||||||
"##### #",
|
{0b_0000010_0},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -53,15 +51,15 @@ func TestTextReadTrivial(t *testing.T) {
|
|||||||
"../../assets/trivial-bigger-staggered.txt",
|
"../../assets/trivial-bigger-staggered.txt",
|
||||||
' ',
|
' ',
|
||||||
'#',
|
'#',
|
||||||
&maze.RawMaze{
|
&RawMaze{
|
||||||
PathChar: ' ',
|
Width: 7,
|
||||||
WallChar: '#',
|
Height: 5,
|
||||||
Data: []string{
|
Data: [][]byte{
|
||||||
"### ###",
|
{0b_0001000_0},
|
||||||
"### ###",
|
{0b_0001000_0},
|
||||||
"# #",
|
{0b_0111110_0},
|
||||||
"#### ##",
|
{0b_0000100_0},
|
||||||
"#### ##",
|
{0b_0000100_0},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -70,21 +68,21 @@ func TestTextReadTrivial(t *testing.T) {
|
|||||||
"../../assets/normal.txt",
|
"../../assets/normal.txt",
|
||||||
' ',
|
' ',
|
||||||
'#',
|
'#',
|
||||||
&maze.RawMaze{
|
&RawMaze{
|
||||||
PathChar: ' ',
|
Width: 11,
|
||||||
WallChar: '#',
|
Height: 11,
|
||||||
Data: []string{
|
Data: [][]byte{
|
||||||
"##### #####",
|
{0b_00000100, 0b000_00000},
|
||||||
"# # #",
|
{0b_01111101, 0b110_00000},
|
||||||
"##### ### #",
|
{0b_00000100, 0b010_00000},
|
||||||
"# # #",
|
{0b_01110111, 0b110_00000},
|
||||||
"# # ##### #",
|
{0b_01010000, 0b010_00000},
|
||||||
"# # #",
|
{0b_01011111, 0b110_00000},
|
||||||
"### ### # #",
|
{0b_00010001, 0b010_00000},
|
||||||
"# # # #",
|
{0b_01110111, 0b010_00000},
|
||||||
"# ####### #",
|
{0b_01000000, 0b010_00000},
|
||||||
"# # #",
|
{0b_01111101, 0b110_00000},
|
||||||
"##### #####",
|
{0b_00000100, 0b000_00000},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -104,5 +102,4 @@ func TestTextReadTrivial(t *testing.T) {
|
|||||||
t.Fatalf("%s: lexed mazes do not match\nGot: %v\nWant: %v", test.name, got, test.expected)
|
t.Fatalf("%s: lexed mazes do not match\nGot: %v\nWant: %v", test.name, got, test.expected)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user