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()
|
2019-02-08 12:30:44 +03:00
|
|
|
_, err := m.LoadVFSColors(false, "/colors.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
|
|
|
}
|