testsuite: Add test for #5248, closes #5248