sapling/tests/test-autofix.t
Jun Wu 4e8707262f tests: change some 'python' to 'hg debugpython'
Summary:
In the future `python` will no longer be able to import `bindings`.
Change them to `hg debugpython` so they stay compatible.

I dropped the "custom hghave" feature. It breaks and I don't think there
are users of it.

Reviewed By: singhsrb

Differential Revision: D17429689

fbshipit-source-id: 96e55ef25a027bd4ad33fc279f27c1d5cbed6861
2019-09-20 18:32:35 -07:00

28 lines
602 B
Raku

#require parso
$ cat > a.py << EOF
> from testutil.autofix import eq
> from testutil.dott import sh
> eq(1 + 2, 0)
> eq(list(range(3)), None)
> eq("\n".join(map(str,range(3))), None)
> sh % "printf foo"
> sh % "printf bar" == "baz"
> EOF
$ hg debugpython -- a.py 2>&1 | tail -1
a.py:3: 3 != 0
$ hg debugpython -- a.py --fix
$ cat a.py
from testutil.autofix import eq
from testutil.dott import sh
eq(1 + 2, 3)
eq(list(range(3)), [0, 1, 2])
eq("\n".join(map(str,range(3))), r"""
0
1
2""")
sh % "printf foo" == 'foo'
sh % "printf bar" == 'bar'