1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

WTF-389 Don't load widgets that have invalid position co-ordinates in their config

This commit is contained in:
Chris Cummer
2019-04-12 04:59:16 -07:00
parent 293e191f1e
commit c9c7e124cc
8 changed files with 203 additions and 100 deletions

View File

@@ -1,27 +0,0 @@
package wtf_tests
import (
"testing"
. "github.com/wtfutil/wtf/wtf"
)
func TestPosition(t *testing.T) {
pos := NewPosition(0, 1, 2, 3)
if pos.Top() != 0 {
t.Fatalf("Expected 0 but got %d", pos.Top())
}
if pos.Left() != 1 {
t.Fatalf("Expected 1 but got %d", pos.Left())
}
if pos.Width() != 2 {
t.Fatalf("Expected 2 but got %d", pos.Width())
}
if pos.Height() != 3 {
t.Fatalf("Expected 3 but got %d", pos.Height())
}
}