forked from marcoheisig/cl4py
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verify that the previous version of cl4py would experience errors because the python readtable was used to read *all* input to the lisp process (instead of only input from the Python process).
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(in-package :common-lisp-user) | ||
|
||
(defun foo-{a7lkj9lakj} () | ||
nil) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from pytest import fixture | ||
import cl4py | ||
import os | ||
|
||
# pytest forces violation of this pylint rule | ||
# pylint: disable=redefined-outer-name | ||
|
||
|
||
@fixture(scope="module") | ||
def lisp(): | ||
return cl4py.Lisp() | ||
|
||
|
||
@fixture(scope="module") | ||
def cl(lisp): | ||
return lisp.function("find-package")("CL") | ||
|
||
|
||
# This test verifies issue underlying MR #9 | ||
def test_readtable_problem(cl): | ||
retval = cl.compile_file( | ||
os.path.join(os.path.dirname(__file__), "sample-program.lisp") | ||
) | ||
outfile = os.path.join(os.path.dirname(__file__), "sample-program.fasl") | ||
try: | ||
assert retval[0] == outfile | ||
assert os.path.exists(retval[0]) | ||
assert retval[1] == () | ||
assert retval[2] == () | ||
finally: | ||
cleanup(outfile) | ||
cleanup(outfile) | ||
|
||
def cleanup(outfile): | ||
if os.path.exists(outfile): | ||
try: | ||
os.remove(outfile) | ||
except: # pylint: disable=bare-except | ||
pass |