MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / test_mul

Method test_mul

linear_algebra/src/test_linear_algebra.py:81–89  ·  view source on GitHub ↗

test for * operator

(self)

Source from the content-addressed store, hash-verified

79 assert (x - y).component(2) == 2
80
81 def test_mul(self) -> None:
82 """
83 test for * operator
84 """
85 x = Vector([1, 2, 3])
86 a = Vector([2, -1, 4]) # for test of dot product
87 b = Vector([1, -2, -1])
88 assert str(x * 3.0) == "(3.0,6.0,9.0)"
89 assert a * b == 0
90
91 def test_zero_vector(self) -> None:
92 """

Callers

nothing calls this directly

Calls 1

VectorClass · 0.85

Tested by

no test coverage detected