@@ -537,4 +537,39 @@ public void negativeInt() {
537
537
assertThat (json , is ("-32" ));
538
538
}
539
539
540
+ @ Test
541
+ public void negativeIntAsJson () throws VPackException {
542
+ final VPackParser parser = new VPackParser .Builder ().build ();
543
+ final String json = parser .toJson (new VPackBuilder ().add (-100 ).slice ());
544
+ assertThat (json , is ("-100" ));
545
+ }
546
+
547
+ @ Test
548
+ public void negativeIntAsJson2 () throws VPackException {
549
+ final VPackParser parser = new VPackParser .Builder ().build ();
550
+ final String json = parser .toJson (new VPackBuilder ().add (-300 ).slice ());
551
+ assertThat (json , is ("-300" ));
552
+ }
553
+
554
+ @ Test
555
+ public void negativeLongAsJson () throws VPackException {
556
+ final VPackParser parser = new VPackParser .Builder ().build ();
557
+ final String json = parser .toJson (new VPackBuilder ().add (-100L ).slice ());
558
+ assertThat (json , is ("-100" ));
559
+ }
560
+
561
+ @ Test
562
+ public void negativeLongAsJson2 () throws VPackException {
563
+ final VPackParser parser = new VPackParser .Builder ().build ();
564
+ final String json = parser .toJson (new VPackBuilder ().add (-300L ).slice ());
565
+ assertThat (json , is ("-300" ));
566
+ }
567
+
568
+ @ Test
569
+ public void negativeLongAsJson3 () throws VPackException {
570
+ final VPackParser parser = new VPackParser .Builder ().build ();
571
+ final String json = parser .toJson (new VPackBuilder ().add (-62135596800L ).slice ());
572
+ assertThat (json , is ("-62135596800" ));
573
+ }
574
+
540
575
}
0 commit comments