rustpkg: Add test for #7338. Closes #7338