# Exam 1 tests - Problem 2 (7 of 20 points)

try:
    from iotest import run_assignment_tests
except ImportError:
    print("❌ Error: Could not find the 'iotest' module.")
    print("Please make sure 'iotest.py' is in the same directory as this test file and your solution program.")
    exit(1)

test_cases = [
    {"args": ["12"], "expected_output": "2"},
    {"args": ["6"], "expected_output": "1"},
    {"args": ["16"], "expected_output": "4"},
    {"args": ["48"], "expected_output": "4"},
    {"args": ["1"], "expected_output": "0"},
    {"args": ["97"], "expected_output": "0"},
    {"args": ["524288"], "expected_output": "19"},
    {"args": ["524300"], "expected_output": "2"},
]

if __name__ == "__main__":
    run_assignment_tests("p2.py", test_cases)

