From 1eac5d8dc2671556f2d8d03c85c9425b284ea555 Mon Sep 17 00:00:00 2001 From: Ben Cragg Date: Mon, 1 Apr 2019 15:33:31 +0100 Subject: [PATCH] Added test templates for new rect tests --- geometry_test.go | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/geometry_test.go b/geometry_test.go index cd95795..8b13f5e 100644 --- a/geometry_test.go +++ b/geometry_test.go @@ -10,6 +10,31 @@ import ( "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) { type rectTestTransform struct { 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) { const delta = 1e-15 t.Run("for rotated matrix", func(t *testing.T) {