@@ -30,6 +30,7 @@ import (
3030
3131 driver "github.com/arangodb/go-driver"
3232
33+ "github.com/stretchr/testify/assert"
3334 "github.com/stretchr/testify/require"
3435)
3536
@@ -509,13 +510,15 @@ func TestUseArangoSearchView(t *testing.T) {
509510func TestArangoSearchViewProperties35 (t * testing.T ) {
510511 ctx := context .Background ()
511512 c := createClientFromEnv (t , true )
512- skipBelowVersion (c , "3.5 " , t )
513+ skipBelowVersion (c , "3.7.1 " , t )
513514 db := ensureDatabase (ctx , c , "view_test" , nil , t )
514515 ensureCollection (ctx , db , "someCol" , nil , t )
515516 commitInterval := int64 (100 )
516517 sortDir := driver .ArangoSearchSortDirectionDesc
517518 name := "test_get_asview_35"
518519 sortField := "foo"
520+ storedValuesFields := []string {"now" , "is" , "the" , "time" }
521+ storedValuesCompression := driver .PrimarySortCompressionNone
519522 opts := & driver.ArangoSearchViewProperties {
520523 Links : driver.ArangoSearchLinks {
521524 "someCol" : driver.ArangoSearchElementProperties {},
@@ -525,6 +528,10 @@ func TestArangoSearchViewProperties35(t *testing.T) {
525528 Field : sortField ,
526529 Direction : & sortDir ,
527530 }},
531+ StoredValues : []driver.StoredValue {{
532+ Fields : storedValuesFields ,
533+ Compression : storedValuesCompression ,
534+ }},
528535 }
529536 if _ , err := db .CreateArangoSearchView (ctx , name , opts ); err != nil {
530537 t .Fatalf ("Failed to create view '%s': %s" , name , describe (err ))
@@ -554,6 +561,17 @@ func TestArangoSearchViewProperties35(t *testing.T) {
554561 t .Errorf ("Primary Sort field is wrong: %s, expected %s" , ps .Field , sortField )
555562 }
556563 }
564+
565+ if len (p .StoredValues ) != 1 {
566+ t .Fatalf ("StoredValues expected length: %d, found %d" , 1 , len (p .StoredValues ))
567+ } else {
568+ sv := p .StoredValues [0 ]
569+ if ! assert .Equal (t , sv .Fields , storedValuesFields ) {
570+ t .Errorf ("StoredValues field is wrong: %s, expected %s" , sv .Fields , storedValuesFields )
571+ } else if sv .Compression != storedValuesCompression {
572+ t .Errorf ("StoredValues Compression is wrong: %s, expected %s" , sv .Compression , storedValuesCompression )
573+ }
574+ }
557575}
558576
559577// TestArangoSearchPrimarySort
0 commit comments