Skip to content

Commit

Permalink
fix testing suite for qiskit result
Browse files Browse the repository at this point in the history
  • Loading branch information
dakk committed Oct 5, 2023
1 parent f9b479f commit 27ed8bc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/test_qlassf_bool.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_no_return_type(self):
exceptions.NoReturnTypeException, lambda f: qlassf(f, to_compile=False), f
)

def test_arg(self):
def test_arg_identity(self):
ex = a
f = "def test(a: bool) -> bool:\n\treturn a"
qf = qlassf(f, to_compile=True)
Expand Down
8 changes: 6 additions & 2 deletions test/test_qlassf_int.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ def test_int_identity(self):
self.assertEqual(qf.expressions[0][1], Symbol("a.0"))
self.assertEqual(qf.expressions[1][0], Symbol("_ret.1"))
self.assertEqual(qf.expressions[1][1], Symbol("a.1"))
# compare_circuit_truth_table(self, qf)
compare_circuit_truth_table(self, qf)

# TODO: need consts
# def test_int_const(self):
# f = "def test(a: Qint2) -> Qint2:\n\tc=1\n\treturn a"
# qf = qlassf(f, to_compile=True)

# TODO: need comparators
# def test_int_compare(self):
Expand All @@ -88,4 +93,3 @@ def test_int_identity(self):

# def test12(a: bool) -> Int8:
# return 42 if a else 38
pass
2 changes: 1 addition & 1 deletion test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ def compare_circuit_truth_table(cls, qf):
)

cls.assertEqual(len(counts), 1)
cls.assertEqual(truth_str, list(counts.keys())[0][0 : len(truth_str)])
cls.assertEqual(truth_str, list(counts.keys())[0][0 : len(truth_str)][::-1])

0 comments on commit 27ed8bc

Please sign in to comment.