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

Method test_sub

linear_algebra/src/test_linear_algebra.py:71–79  ·  view source on GitHub ↗

test for - operator

(self)

Source from the content-addressed store, hash-verified

69 assert (x + y).component(2) == 4
70
71 def test_sub(self) -> None:
72 """
73 test for - operator
74 """
75 x = Vector([1, 2, 3])
76 y = Vector([1, 1, 1])
77 assert (x - y).component(0) == 0
78 assert (x - y).component(1) == 1
79 assert (x - y).component(2) == 2
80
81 def test_mul(self) -> None:
82 """

Callers

nothing calls this directly

Calls 2

VectorClass · 0.85
componentMethod · 0.45

Tested by

no test coverage detected