1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-10 01:40:43 +00:00
OpenDiablo2/d2common/d2fileformats/d2ds1/layer_test.go
gravestench 5dfca5e9f3 WIP
2021-03-24 10:10:36 -07:00

30 lines
515 B
Go

package d2ds1
import "testing"
func Test_layers(t *testing.T) {
const (
fmtWidthHeightError = "unexpected wall layer width/height: %dx%d"
)
l := &layer{}
l.SetSize(0, 0)
if l.Width() != 1 || l.Height() != 1 {
t.Fatalf(fmtWidthHeightError, l.Width(), l.Height())
}
l.SetSize(4, 5)
if l.Width() != 4 || l.Height() != 5 {
t.Fatalf(fmtWidthHeightError, l.Width(), l.Height())
}
l.SetSize(4, 3)
if l.Width() != 4 || l.Height() != 3 {
t.Fatalf(fmtWidthHeightError, l.Width(), l.Height())
}
}