Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tests/test_upstream_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def parse_and_print(path: Path, src: str) -> str:
"""Write *src* to *path*, parse it, and pretty-print back to string."""
path.write_text(src, encoding="utf-8")
nodes = getASTfromFile(str(path), process_includes=False) or []
return to_openscad(nodes)
return to_openscad(nodes) or ""


def pack(entry: Path, library_paths: list[str] | None = None) -> str:
Expand Down Expand Up @@ -127,8 +127,9 @@ def test_three_arg_range_explicit_step_preserved(self, tmp_path):
assert "[0:1:2]" in out

def test_three_arg_range_large_step_preserved(self, tmp_path):
# [0:5:1] means start=0, step=5, end=1 — semantically different from [0:1]
# ([0:5] is a two-arg range: start=0, end=5, implicit step=1.)
# [0:5:1] is a three-arg range [start:step:end] => start=0, step=5, end=1.
# This is semantically different from two-arg [0:1] ([start:end], implicit step=1).
# Likewise, [0:5] is also two-arg and must not replace [0:5:1].
src = "x = [for (i=[0:5:1]) i];"
out = parse_and_print(tmp_path / "t.scad", src)
assert "[0:5:1]" in out
Expand Down
Loading