github.com/amp-space/amp-sdk-go@v0.7.6/stdlib/symbol/memory_table/table_test.go (about)

     1  package memory_table_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/amp-space/amp-sdk-go/stdlib/symbol"
     7  	"github.com/amp-space/amp-sdk-go/stdlib/symbol/memory_table"
     8  	"github.com/amp-space/amp-sdk-go/stdlib/symbol/tests"
     9  )
    10  
    11  var gMemTable symbol.Table
    12  
    13  func Test_memory_table(t *testing.T) {
    14  	open_table := func() (symbol.Table, error) {
    15  		if gMemTable == nil {
    16  			opts :=  memory_table.DefaultOpts()
    17  			gMemTable, _ = opts.CreateTable()
    18  			gMemTable.AddRef() // add ref to get past first close in DoTableTest
    19  		}
    20  		return gMemTable, nil
    21  	}
    22  
    23  	tests.DoTableTest(t, 0, open_table)
    24  }