Skip to content

Commit 5bb0dc7

Browse files
committed
[refactor] Remove redundant struct literals from test
1 parent 7f2cb36 commit 5bb0dc7

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

math_test.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ import (
77
"fmt"
88
"testing"
99

10-
"github.com/elgopher/pi"
1110
"github.com/stretchr/testify/assert"
11+
12+
"github.com/elgopher/pi"
1213
)
1314

1415
const delta = 0.000000000000001
@@ -92,16 +93,16 @@ func TestCos(t *testing.T) {
9293
func TestAtan2(t *testing.T) {
9394
type params struct{ dx, dy float64 }
9495
tests := map[params]float64{
95-
params{0, 0}: 0.75, // TODO In Pico-8 this is 0.25
96-
params{0.001, 0.001}: 0.875,
97-
params{0, 1}: 0.75,
98-
params{1, 0}: 0,
99-
params{1, 1}: 0.875,
100-
params{-1, -1}: 0.375,
101-
params{-1, 1}: 0.625,
102-
params{1, -1}: 0.125,
103-
params{1, 2}: 0.8237918088252166,
104-
params{1, -0.3}: 0.04638678953887121,
96+
{0, 0}: 0.75, // TODO In Pico-8 this is 0.25
97+
{0.001, 0.001}: 0.875,
98+
{0, 1}: 0.75,
99+
{1, 0}: 0,
100+
{1, 1}: 0.875,
101+
{-1, -1}: 0.375,
102+
{-1, 1}: 0.625,
103+
{1, -1}: 0.125,
104+
{1, 2}: 0.8237918088252166,
105+
{1, -0.3}: 0.04638678953887121,
105106
}
106107
for p, expected := range tests {
107108
name := fmt.Sprintf("%+v", p)

0 commit comments

Comments
 (0)