tins2021/level_test.go
Sander Schobers 13b6a50a45 Added bitmap font.
Added monsters.
Added animations.
Added rendering of geometries.
2021-08-09 01:25:51 +02:00

32 lines
616 B
Go

package tins2021
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestNewLevelIsAllReachable(t *testing.T) {
level := NewLevel()
assert.True(t, level.Tiles.AllReachable(level.Player))
}
func TestRandomizedLevelIsAllReachable(t *testing.T) {
level := NewLevel()
level.Randomize(len(level.Tiles)/2, 0)
assert.True(t, level.Tiles.AllReachable(level.Player))
}
func BenchmarkRandomizedLevel(b *testing.B) {
for i := 0; i < b.N; i++ {
level := NewLevel()
level.Randomize(len(level.Tiles)*50/100, 0)
}
}
func BenchmarkNewLevel(b *testing.B) {
for i := 0; i < b.N; i++ {
NewLevel()
}
}