Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve tests for Subsequence Indices
Original tests: - When `arr` and `sub` are arbitrary, check that if `subsequenceIndices(arr, sub)` returns non-null, then the returned indices are correct. - When `sub` is guaranteed to be a subsequence of `arr`, check that `subsequenceIndices(arr, sub)` never returns null. New tests: - When `sub` is guaranteed to be a subsequence of `arr`, check `subsequenceIndices(arr, sub)` returns non-null, correct indices. - When `arr` and `sub` are arbitrary, check that if `subsequenceIndices(arr, sub)` returns non-null, then the returned indices are correct. Adding the indices correctness check to both tests allows us to use the guaranteed-subsequence test as the primary test for the success case (non-null return), with the arbitrary-inputs test primarily accounting for the failure case now. This allows us to vary the inputs to the arbitrary-inputs test more, since we are no longer depending on it for coverage of the success case. Also, the inputs to the guaranteed-subsequence test are now decoupled from the inputs to the arbitrary-inputs test, and are even more varied.
- Loading branch information