Added test templates for new rect tests
This commit is contained in:
parent
a5ea71811e
commit
1eac5d8dc2
|
@ -10,6 +10,31 @@ import (
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestRect_Edges(t *testing.T) {
|
||||||
|
type fields struct {
|
||||||
|
Min pixel.Vec
|
||||||
|
Max pixel.Vec
|
||||||
|
}
|
||||||
|
tests := []struct {
|
||||||
|
name string
|
||||||
|
fields fields
|
||||||
|
want [4]pixel.Line
|
||||||
|
}{
|
||||||
|
// TODO: Add test cases.
|
||||||
|
}
|
||||||
|
for _, tt := range tests {
|
||||||
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
r := pixel.Rect{
|
||||||
|
Min: tt.fields.Min,
|
||||||
|
Max: tt.fields.Max,
|
||||||
|
}
|
||||||
|
if got := r.Edges(); !reflect.DeepEqual(got, tt.want) {
|
||||||
|
t.Errorf("Rect.Edges() = %v, want %v", got, tt.want)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestRect_Resize(t *testing.T) {
|
func TestRect_Resize(t *testing.T) {
|
||||||
type rectTestTransform struct {
|
type rectTestTransform struct {
|
||||||
name string
|
name string
|
||||||
|
@ -80,6 +105,31 @@ func TestRect_Resize(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestRect_Vertices(t *testing.T) {
|
||||||
|
type fields struct {
|
||||||
|
Min pixel.Vec
|
||||||
|
Max pixel.Vec
|
||||||
|
}
|
||||||
|
tests := []struct {
|
||||||
|
name string
|
||||||
|
fields fields
|
||||||
|
want [4]pixel.Vec
|
||||||
|
}{
|
||||||
|
// TODO: Add test cases.
|
||||||
|
}
|
||||||
|
for _, tt := range tests {
|
||||||
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
r := pixel.Rect{
|
||||||
|
Min: tt.fields.Min,
|
||||||
|
Max: tt.fields.Max,
|
||||||
|
}
|
||||||
|
if got := r.Vertices(); !reflect.DeepEqual(got, tt.want) {
|
||||||
|
t.Errorf("Rect.Vertices() = %v, want %v", got, tt.want)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestMatrix_Unproject(t *testing.T) {
|
func TestMatrix_Unproject(t *testing.T) {
|
||||||
const delta = 1e-15
|
const delta = 1e-15
|
||||||
t.Run("for rotated matrix", func(t *testing.T) {
|
t.Run("for rotated matrix", func(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue