mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
28 lines
443 B
Go
28 lines
443 B
Go
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())
|
|
}
|
|
}
|