Skip to content

Commit

Permalink
implements test for issue #7
Browse files Browse the repository at this point in the history
  • Loading branch information
Aluriak committed Jun 5, 2019
1 parent 4207699 commit f6032f5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion clyngor/test/test_answers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import pytest
import clyngor
from clyngor.answers import Answers
from clyngor.as_pyasp import Atom, TermSet

Expand Down Expand Up @@ -117,7 +118,14 @@ def test_as_pyasp_atom():
assert atom == Atom(predicate='a', args=(1,'"2.3"'))
print(atom)


def test_bug_issue_7():
"inconsistencies in parsing when clingo module is used"
models = clyngor.solve(inline='a(1). e(X):- a(X).', use_clingo_module=True).sorted.atoms_as_string
model = next(models)
assert model == ('a(1)', 'e(1)')
with pytest.raises(StopIteration):
next(models) # only one model
# assert False, 'everything ok'

def test_as_pyasp_termset_frozenset():
answers = Answers(('a("b","d")',)).as_pyasp
Expand Down

0 comments on commit f6032f5

Please sign in to comment.