2020-01-26 00:39:13 -05:00
|
|
|
package d2dt1
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2020-04-11 14:56:47 -04:00
|
|
|
|
|
|
|
testify "github.com/stretchr/testify/assert"
|
2020-01-26 00:39:13 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestNewSubTile(t *testing.T) {
|
|
|
|
assert := testify.New(t)
|
|
|
|
data := []byte{1, 2, 4, 8, 16, 32, 64, 128}
|
|
|
|
|
|
|
|
for i, b := range data {
|
|
|
|
tile := NewSubTileFlags(b)
|
|
|
|
assert.Equal(i == 0, tile.BlockWalk)
|
|
|
|
assert.Equal(i == 1, tile.BlockLOS)
|
|
|
|
assert.Equal(i == 2, tile.BlockJump)
|
|
|
|
assert.Equal(i == 3, tile.BlockPlayerWalk)
|
|
|
|
assert.Equal(i == 4, tile.Unknown1)
|
|
|
|
assert.Equal(i == 5, tile.BlockLight)
|
|
|
|
assert.Equal(i == 6, tile.Unknown2)
|
|
|
|
assert.Equal(i == 7, tile.Unknown3)
|
|
|
|
}
|
|
|
|
}
|