def test_trailing_whitespace(self):
        r = b'{ "foo": "bar" } '
        ctx = split_string(r)
        self.assertEqual(ctx.error, 0)
        self.assertEqual(ctx.offset, len(r)-1)
        error = _lib.json_split(ctx)
        self.assertEqual(error, ctx.error) == _lib.INCOMPLETE
        self.assertEqual(ctx.offset, len(r))