File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
src/test/java/com/arangodb/velocypack Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -392,9 +392,31 @@ public void unindexedArray() throws VPackException {
392
392
}
393
393
}
394
394
395
+ @ Test
396
+ public void unindexedSingletonArray () throws VPackException {
397
+ final long [] expected = {1 };
398
+ final VPackBuilder builder = new VPackBuilder ();
399
+ builder .getOptions ().setBuildUnindexedArrays (true );
400
+ builder .add (ValueType .ARRAY , false );
401
+ for (final long l : expected ) {
402
+ builder .add (l );
403
+ }
404
+ builder .close ();
405
+
406
+ final VPackSlice slice = builder .slice ();
407
+ assertThat (slice .isArray (), is (true ));
408
+ assertThat (slice .getLength (), is (1 ));
409
+ for (int i = 0 ; i < expected .length ; i ++) {
410
+ final VPackSlice at = slice .get (i );
411
+ assertThat (at .isInteger (), is (true ));
412
+ assertThat (at .getAsLong (), is (expected [i ]));
413
+ }
414
+ }
415
+
416
+
395
417
@ Test
396
418
public void indexedArray () throws VPackException {
397
- final long [] values = { 1 , 2 , 3 };
419
+ final long [] values = {1 , 2 , 3 };
398
420
final VPackBuilder builder = new VPackBuilder ();
399
421
builder .add (ValueType .ARRAY );
400
422
for (final long l : values ) {
You can’t perform that action at this time.
0 commit comments