Added test to exercise all cases