From a4722eae05b71c5fc76e2ee22eaf51bf9ab9f5ca Mon Sep 17 00:00:00 2001 From: 0xAlankar <127030034+0xAlankar@users.noreply.github.com> Date: Tue, 17 Sep 2024 15:41:32 +0530 Subject: [PATCH] add case insensitivity There was a problem with check50 not accepting the output case insensitively; thus, I made the necessary changes to include it. --- coke/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/coke/__init__.py b/coke/__init__.py index 802b8cfe..4d817e11 100644 --- a/coke/__init__.py +++ b/coke/__init__.py @@ -13,6 +13,7 @@ def test_25(): """coke accepts 25 cents""" input = "25" output = "Amount Due: 25\n" + output = output.lower() check50.run("python3 coke.py").stdin(input, prompt=True).stdout(output, regex=True).kill() @@ -21,6 +22,7 @@ def test_10(): """coke accepts 10 cents""" input = "10" output = "Amount Due: 40\n" + output = output.lower() check50.run("python3 coke.py").stdin(input, prompt=True).stdout(output, regex=True).kill() @@ -29,6 +31,7 @@ def test_1(): """coke accepts 5 cents""" input = "5" output = "Amount Due: 45\n" + output = output.lower() check50.run("python3 coke.py").stdin(input, prompt=True).stdout(output, regex=True).kill() @@ -37,6 +40,7 @@ def test_invalid(): """coke rejects invalid amount of cents""" input = "30" output = "Amount Due: 50\n" + output = output.lower() check50.run("python3 coke.py").stdin(input, prompt=True).stdout(output, regex=True).kill() @@ -45,6 +49,7 @@ def test_multiple(): """coke accepts continued input""" input = "10" output = "Amount Due: 30\n" + output = output.lower() check50.run("python3 coke.py").stdin(input, prompt=True).stdin(input, prompt=True).stdout(output, regex=True).kill() @@ -53,6 +58,7 @@ def test_terminate(): """coke terminates at 50 cents""" input = "10" output = "Change Owed: 0\n" + output = output.lower() check50.run("python3 coke.py").stdin(input, prompt=True).stdin(input, prompt=True).stdin(input, prompt=True).stdin(input, prompt=True).stdin(input, prompt=True).stdout(output, regex=True).exit() @@ -61,4 +67,5 @@ def test_change(): """coke provides correct change""" input = "25" output = "Change Owed: 10\n" + output = output.lower() check50.run("python3 coke.py").stdin(input, prompt=True).stdin("10", prompt=True).stdin(input, prompt=True).stdout(output, regex=True).exit()