Tests for #5759

#5759