The relock_position, relock_partial_position, and relock_from_balance functions work as expected: when these functions generate two positions (one of which existed before executing the function) with n days, the positions are merged.
The unlock_position, unlock_partial_position, and locking_position_extend_days functions work incorrectly: when these functions generate two positions (one of which existed before executing the function) with n days, the positions are not merged, leaving one pre-existing position and a new position after executing the function.