xonsh/tests/test_bashisms.py

13 lines
353 B
Python
Raw Normal View History

2016-11-20 18:35:30 -05:00
"""Tests bashisms xontrib."""
import pytest
2018-08-30 09:18:49 -05:00
@pytest.mark.parametrize("inp, exp", [("x = 42", "x = 42"), ("!!", "ls")])
2016-11-20 18:35:30 -05:00
def test_preproc(inp, exp, xonsh_builtins):
"""Test the bash preprocessor."""
from xontrib.bashisms import bash_preproc
2018-08-30 09:18:49 -05:00
xonsh_builtins.__xonsh_history__.inps = ["ls\n"]
2016-11-20 18:35:30 -05:00
obs = bash_preproc(inp)
2018-08-30 09:18:49 -05:00
assert exp == obs