Add a test for the fix of issue 16589