def test_bash_transform_sample(): ok, content = bash_transform( code="sed 's/A/B/g'", content="ACTGA", ) assert ok is True assert content == "BCTGB"
def test_empty_stdin_is_skipped(): ok, content = bash_transform( code="no such command", content="", ) assert ok is True assert content == ""
def test_bash_transform_error_is_captured(): ok, content = bash_transform( code="ls /NO-SUCH-DIR", content="?", ) assert ok is False assert "ls: cannot access" in content assert "/NO-SUCH-DIR" in content assert "No such file or directory" in content