# Practicum 2 Tests - Problem 3

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.")
    print("'iotest.py' was included with the practicum zip file.")
    exit(1)
"""
Examples:
>>> %Run p3.py 2 2 3 1
6x^2 + 8x + 2
>>> %Run p3.py 1 2 0 3
0x^2 + 3x + 6
>>> %Run p3.py 1 4 -3 2
-3x^2 + -10x + 8
"""

test_cases = [
    {
        "args": ["2", "2", "3", "1"],
        "expected_output": "6x^2 + 8x + 2"
    },
    {
        "args": ["1", "2", "0", "3"],
        "expected_output": "0x^2 + 3x + 6"
    },
    {
        "args": ["1", "4", "-3", "2"],
        "expected_output": "-3x^2 + -10x + 8"
    },
    {
        "args": ["-7", "5", "9", "24"],
        "expected_output": "-63x^2 + -123x + 120"
    },
]

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

