Add a test for encoding various types.