Skip to content

Commit

Permalink
fix index test
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Solender committed Sep 10, 2021
1 parent 5ee8c11 commit f14e277
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package gogm

import (
"context"
"github.com/stretchr/testify/require"
"log"
"reflect"
Expand All @@ -30,10 +31,10 @@ func testIndexManagement(req *require.Assertions) {
req.Nil(err)
req.NotNil(gogm)
//delete everything
req.Nil(dropAllIndexesAndConstraints(gogm))
req.Nil(dropAllIndexesAndConstraints(context.Background(), gogm))

//setup structure
mapp := toHashmapStructdecconf(map[string]structDecoratorConfig{
_map := toHashmapStructdecconf(map[string]structDecoratorConfig{
"TEST1": {
Label: "Test1",
IsVertex: true,
Expand Down Expand Up @@ -79,13 +80,13 @@ func testIndexManagement(req *require.Assertions) {
})

//create stuff
req.Nil(createAllIndexesAndConstraints(gogm, mapp))
req.Nil(createAllIndexesAndConstraints(context.Background(), gogm, _map))

log.Println("created indices and constraints")

//validate
req.Nil(verifyAllIndexesAndConstraints(gogm, mapp))
req.Nil(verifyAllIndexesAndConstraints(context.Background(), gogm, _map))

//clean up
req.Nil(dropAllIndexesAndConstraints(gogm))
req.Nil(dropAllIndexesAndConstraints(context.Background(), gogm))
}

0 comments on commit f14e277

Please sign in to comment.