add test to sprintf to cover metadata support

Fixes #2149