is_consecutive and test cases