if the user submitted solution is shit wrong then fucking dont add to the shit database.
also removed unnccessary fucking function
This commit is contained in:
27
src/problems/ReversedList/test.py
Normal file
27
src/problems/ReversedList/test.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import unittest
|
||||
|
||||
#def reverse_list(lst : list) -> list:
|
||||
#return lst[::-1]
|
||||
|
||||
class TestSolution(unittest.TestCase):
|
||||
def test_simple(self):
|
||||
test_cases = [
|
||||
([1, 2, 3], [3, 2, 1]), # Simple case
|
||||
([1, 2, 3, 4], [4, 3, 2, 1]), # Longer list
|
||||
([], []), # Empty list
|
||||
([5], [5]), # Single element list
|
||||
([1, 'a', True], [True, 'a', 1]) # Mixed types
|
||||
]
|
||||
print("\n FUNCTION OUTPUT TEST RESULTS")
|
||||
|
||||
for input_val , expected in test_cases:
|
||||
try:
|
||||
actual = reverse_list(input_val) # pyright: ignore[reportUndefinedVariable]
|
||||
status = "✓ PASS" if actual == expected else "✗ FAIL"
|
||||
print(f"{status} | Input: {input_val} -> Got: {actual} | Expected: {expected}")
|
||||
self.assertEqual(actual, expected)
|
||||
except Exception as e:
|
||||
print(f"✗ ERROR | Input: {input_val} -> Exception: {e}")
|
||||
raise
|
||||
if __name__ == "__main__":
|
||||
unittest.main(verbosity=2)
|
||||
Reference in New Issue
Block a user