Thanks for that code. Could you add a tests for `combine_time_segments` function?