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

Function test_string_find_substr

tests/python/test_string.py:58–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56
57
58def test_string_find_substr() -> None:
59 s = tvm_ffi.core.String("hello world")
60 assert s.find("world") == 6
61 assert s.find("hello") == 0
62 assert s.find("o") == 4
63 assert s.find("o", 5) == 7
64 assert s.find("notfound") == -1
65 assert s.find("") == 0
66 assert s.find("", 5) == 5
67 assert s.find("", 11) == 11
68 assert s.find("", 20) == -1
69
70 assert s[6:11] == "world"
71 assert s[0:5] == "hello"
72 assert s[6:] == "world"
73 assert s[:5] == "hello"

Callers

nothing calls this directly

Calls 2

findMethod · 0.95
StringMethod · 0.80

Tested by

no test coverage detected