3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-08-19 03:12:18 +00:00
sby/tests/links/symlink.py
2025-07-05 15:46:40 +12:00

18 lines
503 B
Python

import os
from pathlib import Path
import sys
def main():
workdir, task = sys.argv[1:]
src = Path(workdir) / "src"
for srcfile in src.iterdir():
if srcfile.name == "heredoc":
assert(not srcfile.is_symlink())
with open(srcfile, "r") as f:
local_contents = f.readline()
assert(local_contents.strip() == 'log foo')
else:
assert(srcfile.is_symlink() == (task == "link"))
if __name__ == "__main__":
main()