Converted tests into doctests (#10572)

* Converted tests into doctests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removed commented code

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Akshar Goyal
2023-10-16 03:21:43 -04:00
committed by GitHub
parent cc0405d05c
commit f4ff73b1bd
8 changed files with 24 additions and 87 deletions

View File

@ -31,16 +31,7 @@ def xor_gate(input_1: int, input_2: int) -> int:
return (input_1, input_2).count(0) % 2
def test_xor_gate() -> None:
"""
Tests the xor_gate function
"""
assert xor_gate(0, 0) == 0
assert xor_gate(0, 1) == 1
assert xor_gate(1, 0) == 1
assert xor_gate(1, 1) == 0
if __name__ == "__main__":
print(xor_gate(0, 0))
print(xor_gate(0, 1))
import doctest
doctest.testmod()