test cases for reduce space