Add a test case for subscript method