mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-04 16:57:32 +08:00
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:
@ -29,18 +29,7 @@ def or_gate(input_1: int, input_2: int) -> int:
|
||||
return int((input_1, input_2).count(1) != 0)
|
||||
|
||||
|
||||
def test_or_gate() -> None:
|
||||
"""
|
||||
Tests the or_gate function
|
||||
"""
|
||||
assert or_gate(0, 0) == 0
|
||||
assert or_gate(0, 1) == 1
|
||||
assert or_gate(1, 0) == 1
|
||||
assert or_gate(1, 1) == 1
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(or_gate(0, 1))
|
||||
print(or_gate(1, 0))
|
||||
print(or_gate(0, 0))
|
||||
print(or_gate(1, 1))
|
||||
import doctest
|
||||
|
||||
doctest.testmod()
|
||||
|
Reference in New Issue
Block a user