[MAINT] Add unit tests for the localization of local extrema.

As the title says.