MCPcopy Create free account
hub / github.com/argotorg/solidity / extract_and_write

Function extract_and_write

scripts/isolate_tests.py:114–132  ·  view source on GitHub ↗
(path, language)

Source from the content-addressed store, hash-verified

112 fi.write(remainder)
113
114def extract_and_write(path, language):
115 assert language in ["solidity", "yul", ""]
116 yulCases = []
117 cases = []
118
119 if path.lower().endswith('.rst'):
120 if language in ("solidity", ""):
121 cases = extract_solidity_docs_cases(path)
122
123 if language in ("yul", ""):
124 yulCases = extract_yul_docs_cases(path)
125 elif path.endswith('.sol'):
126 if language in ("solidity", ""):
127 with open(path, mode='r', encoding='utf8', newline='') as f:
128 cases = [f.read()]
129 else:
130 cases = extract_test_cases(path)
131
132 write_cases(basename(path), cases, yulCases)
133
134if __name__ == '__main__':
135 script_description = (

Callers 1

isolate_tests.pyFile · 0.70

Calls 4

extract_yul_docs_casesFunction · 0.85
extract_test_casesFunction · 0.70
write_casesFunction · 0.70

Tested by

no test coverage detected