MCPcopy Index your code
hub / github.com/EngoEngine/engo / TestPointMethodChain

Function TestPointMethodChain

math_test.go:757–770  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

755}
756
757func TestPointMethodChain(t *testing.T) {
758 p1 := Point{X: 2, Y: 2}
759 p2 := Point{X: 5, Y: 5}
760
761 p1.Add(p2).Multiply(p2).Subtract(*p2.MultiplyScalar(2)).AddScalar(25).SubtractScalar(8)
762
763 if p1.X != 42 {
764 t.Errorf("Point method chain failed. p1.X should be 42, not %v", p1.X)
765 }
766
767 if p1.Y != 42 {
768 t.Errorf("Point method chain failed. p1.Y should be 42, not %v", p1.Y)
769 }
770}
771
772func TestMatrixSet(t *testing.T) {
773 m := IdentityMatrix()

Callers

nothing calls this directly

Calls 6

AddMethod · 0.95
MultiplyScalarMethod · 0.95
SubtractScalarMethod · 0.80
AddScalarMethod · 0.80
SubtractMethod · 0.80
MultiplyMethod · 0.45

Tested by

no test coverage detected