mapserver/colormapping/colormapping_test.go

39 lines
624 B
Go
Raw Normal View History

2019-01-11 12:49:19 +03:00
package colormapping
import (
"testing"
)
func TestNewMapping(t *testing.T) {
2019-01-13 18:37:03 +03:00
m := NewColorMapping()
_, err := m.LoadVFSColors(false, "/colors/vanessa.txt")
if err != nil {
t.Fatal(err)
}
_, err = m.LoadVFSColors(false, "/colors/scifi_nodes.txt")
2019-01-13 18:37:03 +03:00
if err != nil {
t.Fatal(err)
}
2019-01-11 13:23:50 +03:00
2019-06-20 08:14:14 +03:00
c := m.GetColor("scifi_nodes:blacktile2", 0)
2019-01-13 18:37:03 +03:00
if c == nil {
panic("no color")
}
2019-01-11 13:23:50 +03:00
2019-06-20 08:14:14 +03:00
c = m.GetColor("default:river_water_flowing", 0)
2019-02-27 18:24:53 +03:00
if c == nil {
panic("no color")
}
2019-06-20 08:55:18 +03:00
c = m.GetColor("unifiedbricks:brickblock_multicolor_dark", 100)
if c == nil {
panic("no color")
}
2019-02-28 22:20:59 +03:00
//if c.A != 128 {
// panic("wrong alpha")
//}
2019-02-27 18:24:53 +03:00
2019-01-11 12:49:19 +03:00
}