-
Notifications
You must be signed in to change notification settings - Fork 20
Exercise 2 (edge cases) #7
Description
Edge cases of compute_overlap
We've discussed edge cases in class. Edge cases help us check that our compute_overlap function behaves correctly when it gets passed different types of valid input.
For example, some edge cases that we haven't tested yet are:
- two time ranges that partially overlap
- two time ranges that don't overlap (see Exercise 1+ (no overlap) #6 )
- two time ranges that both have multiple sub-time-ranges
- two time ranges with one starting exactly at the same time as the other ends
- two time ranges that exactly coincide
- ...
Write an edge case test
In this exercise, your job is to add a further test to test_times.py that checks one of these edge cases.
This new test will have a similar structure as before.
Remember to run the tests and check that they pass before pushing to your repository.
If you find any bugs, have a go at fixing them.
Once you're happy with your additional test, commit your changes to your repository with a meaningful commit message that also links to this issue.
> git add test_times.py
> git commit -m "<meaningful commit message here>. Answers UCL-RITS/ipls-workshop#7"
and push it to your fork.
> git push
Further exercises
If you've gotten this far, well done! 🚀
You've finished exercise 2. You can add more tests for the other edge cases if you like.
Otherwise, here are some more exercises to keep you busy:
- parametrising tests Exercise 2+ (parametrising your tests) #8
- negative tests Exercise 2+ (negative tests) #9