MCPcopy Create free account
hub / github.com/apache/tvm-ffi / test_path_equal

Function test_path_equal

tests/python/test_access_path.py:110–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108
109
110def test_path_equal() -> None:
111 # Root equals root
112 assert AccessPath.root() == AccessPath.root()
113
114 # Root does not equal non-root paths
115 assert not (AccessPath.root() == AccessPath.root().attr("foo"))
116
117 # Non-root does not equal root
118 assert not (AccessPath.root().attr("foo") == AccessPath.root())
119
120 # Path equals itself
121 assert AccessPath.root().attr("foo") == AccessPath.root().attr("foo")
122
123 # Different attrs are not equal
124 assert not (AccessPath.root().attr("bar") == AccessPath.root().attr("foo"))
125
126 # Shorter path does not equal longer path
127 assert not (AccessPath.root().attr("foo") == AccessPath.root().attr("foo").array_item(2))
128
129 # Longer path does not equal shorter path
130 assert not (AccessPath.root().attr("foo").array_item(2) == AccessPath.root().attr("foo"))
131
132 # Different paths are not equal
133 assert not (AccessPath.root().attr("foo") == AccessPath.root().attr("bar").array_item(2))

Callers

nothing calls this directly

Calls 3

rootMethod · 0.80
attrMethod · 0.80
array_itemMethod · 0.80

Tested by

no test coverage detected