This code didn't have regression tests yet. Add tests for #120051, with meshes with and without boundary edges.