Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Exercise 2 (edge cases) #7

Open
alessandrofelder opened this issue Apr 28, 2021 · 0 comments
Open

Exercise 2 (edge cases) #7

alessandrofelder opened this issue Apr 28, 2021 · 0 comments

Comments

@alessandrofelder
Copy link
Collaborator

alessandrofelder commented Apr 28, 2021

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:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant