@@ -168,6 +168,7 @@ public void testGeoTileFormat() {
168168 public void testRawParse () {
169169 assertEquals (-1L , DocValueFormat .RAW .parseLong ("-1" , randomBoolean (), null ));
170170 assertEquals (1L , DocValueFormat .RAW .parseLong ("1" , randomBoolean (), null ));
171+ assertEquals (Long .MAX_VALUE - 2 , DocValueFormat .RAW .parseLong (Long .toString (Long .MAX_VALUE - 2 ), randomBoolean (), null ));
171172 // not checking exception messages as they could depend on the JVM
172173 expectThrows (IllegalArgumentException .class , () -> DocValueFormat .RAW .parseLong ("" , randomBoolean (), null ));
173174 expectThrows (IllegalArgumentException .class , () -> DocValueFormat .RAW .parseLong ("abc" , randomBoolean (), null ));
@@ -176,8 +177,8 @@ public void testRawParse() {
176177 assertEquals (1d , DocValueFormat .RAW .parseDouble ("1" , randomBoolean (), null ), 0d );
177178 assertEquals (.5 , DocValueFormat .RAW .parseDouble ("0.5" , randomBoolean (), null ), 0d );
178179 // not checking exception messages as they could depend on the JVM
179- expectThrows (IllegalArgumentException .class , () -> DocValueFormat .RAW .parseLong ("" , randomBoolean (), null ));
180- expectThrows (IllegalArgumentException .class , () -> DocValueFormat .RAW .parseLong ("abc" , randomBoolean (), null ));
180+ expectThrows (IllegalArgumentException .class , () -> DocValueFormat .RAW .parseDouble ("" , randomBoolean (), null ));
181+ expectThrows (IllegalArgumentException .class , () -> DocValueFormat .RAW .parseDouble ("abc" , randomBoolean (), null ));
181182
182183 assertEquals (new BytesRef ("abc" ), DocValueFormat .RAW .parseBytesRef ("abc" ));
183184 }
0 commit comments