MCPcopy Create free account
hub / github.com/executablebooks/markdown-it-py / read_fixture_file

Function read_fixture_file

markdown_it/utils.py:175–194  ·  view source on GitHub ↗
(path: str | Path)

Source from the content-addressed store, hash-verified

173
174
175def read_fixture_file(path: str | Path) -> list[list[Any]]:
176 text = Path(path).read_text(encoding="utf-8")
177 tests = []
178 section = 0
179 last_pos = 0
180 lines = text.splitlines(keepends=True)
181 for i in range(len(lines)):
182 if lines[i].rstrip() == ".":
183 if section == 0:
184 tests.append([i, lines[i - 1].strip()])
185 section = 1
186 elif section == 1:
187 tests[-1].append("".join(lines[last_pos + 1 : i]))
188 section = 2
189 elif section == 2:
190 tests[-1].append("".join(lines[last_pos + 1 : i]))
191 section = 0
192
193 last_pos = i
194 return tests

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…