From 87a789af515333c35aed1060c7a2b5c7d287123c Mon Sep 17 00:00:00 2001 From: "Marvin M. Michum" Date: Mon, 5 Aug 2019 01:05:36 -0400 Subject: [PATCH] Boolean algebra pytests (#1097) * Added Zeller's congruence algorithm * Update args help * add a few doctests * remove old file --- boolean_algebra/quine_mc_cluskey.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/boolean_algebra/quine_mc_cluskey.py b/boolean_algebra/quine_mc_cluskey.py index db4d153cb..94319ca45 100644 --- a/boolean_algebra/quine_mc_cluskey.py +++ b/boolean_algebra/quine_mc_cluskey.py @@ -1,3 +1,18 @@ +""" + doctests + + >>> decimal_to_binary(3,[1.5]) + ['0.00.01.5'] + + >>> check(['0.00.01.5']) + ['0.00.01.5'] + + >>> prime_implicant_chart(['0.00.01.5'],['0.00.01.5']) + [[1]] + + >>> selection([[1]],['0.00.01.5']) + ['0.00.01.5'] +""" def compare_string(string1, string2): l1 = list(string1); l2 = list(string2) count = 0 @@ -113,4 +128,6 @@ def main(): print(essential_prime_implicants) if __name__ == '__main__': + import doctest + doctest.testmod() main()