Skip to content

Commit 030e3d9

Browse files
author
Szymon Szeliga
committedAug 23, 2016
Format vector tests
1 parent e2a948d commit 030e3d9

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed
 

‎core/vector_test.go

+14-7
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ func TestMultiplyByScalar(t *testing.T) {
2222
}
2323

2424
func TestLength(t *testing.T) {
25-
assert.Equal(t, 3., Vector{3., 0., 0.}.Length(), "calculates the length(magnitude) correctly for Vector{3., 0., 0.}")
26-
assert.Equal(t, 6., Vector{6., 0., 0.}.Length(), "calculates the length(magnitude) correctly for Vector{6., 0., 0.}")
27-
assert.Equal(t, 6.324555320336759, Vector{6., 2., 0.}.Length(), "calculates the length(magnitude) correctly for Vector{6., 2., 0.}")
25+
assert.Equal(t, 3., Vector{3., 0., 0.}.Length(),
26+
"calculates the length(magnitude) correctly for Vector{3., 0., 0.}")
27+
assert.Equal(t, 6., Vector{6., 0., 0.}.Length(),
28+
"calculates the length(magnitude) correctly for Vector{6., 0., 0.}")
29+
assert.Equal(t, 6.324555320336759, Vector{6., 2., 0.}.Length(),
30+
"calculates the length(magnitude) correctly for Vector{6., 2., 0.}")
2831
}
2932

3033
func TestDotProductOfTwoPerpendicularVectors(t *testing.T) {
@@ -39,11 +42,15 @@ func TestDotProductOfTwoParallelVectors(t *testing.T) {
3942

4043
func TestCrossProduct(t *testing.T) {
4144
result := Vector{1., 0., 0.}.Cross(Vector{0., 1., 0.})
42-
assert.Equal(t, Vector{0., 0., 1.}, result, "cross product returns a vector perpendicular to the other two")
45+
assert.Equal(t, Vector{0., 0., 1.}, result,
46+
"cross product returns a vector perpendicular to the other two")
4347
}
4448

4549
func TestNormalize(t *testing.T) {
46-
assert.Equal(t, Vector{1., 0., 0.}, Vector{10., 0., 0.}.Normalize(), "returns a unit vector (versor) from the given vector")
47-
assert.Equal(t, Vector{0., 1., 0.}, Vector{0., 10., 0.}.Normalize(), "returns a unit vector (versor) from the given vector")
48-
assert.Equal(t, Vector{0., 0., 1.}, Vector{0., 0., 10.}.Normalize(), "returns a unit vector (versor) from the given vector")
50+
assert.Equal(t, Vector{1., 0., 0.}, Vector{10., 0., 0.}.Normalize(),
51+
"returns a unit vector (versor) from the given vector")
52+
assert.Equal(t, Vector{0., 1., 0.}, Vector{0., 10., 0.}.Normalize(),
53+
"returns a unit vector (versor) from the given vector")
54+
assert.Equal(t, Vector{0., 0., 1.}, Vector{0., 0., 10.}.Normalize(),
55+
"returns a unit vector (versor) from the given vector")
4956
}

0 commit comments

Comments
 (0)
Please sign in to comment.