File tree 1 file changed +14
-10
lines changed
1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -161,18 +161,22 @@ public void testOBBig1(){
161
161
}
162
162
163
163
@ Test
164
- public void testUTF8 (){
165
- for ( int i = 1 ; i <= Character .MAX_CODE_POINT ; i ++ ) {
166
-
167
- if ( ! Character .isValidCodePoint ( i ) )
164
+ public void testUTF8 () {
165
+ for (int i = 1 ; i <= Character .MAX_CODE_POINT ; i ++) {
166
+
167
+ if (! Character .isValidCodePoint (i )) {
168
168
continue ;
169
-
170
- String orig = new String ( Character .toChars ( i ) );
171
- BSONObject a = new BasicBSONObject ( orig , orig );
172
- BSONObject b = BSON .decode ( BSON .encode ( a ) );
173
- assertEquals ( a , b );
174
- }
169
+ }
175
170
171
+ if (Character .isSurrogate ((char ) i )) {
172
+ continue ;
173
+ }
174
+
175
+ String orig = new String (Character .toChars (i ));
176
+ BSONObject a = new BasicBSONObject (orig , orig );
177
+ BSONObject b = BSON .decode (BSON .encode (a ));
178
+ assertEquals (a , b );
179
+ }
176
180
}
177
181
178
182
@ Test
You can’t perform that action at this time.
0 commit comments