MCPcopy Index your code
hub / github.com/ByteStorage/FlyDB / TestNewSetStructure

Function TestNewSetStructure

structure/set_test.go:953–967  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

951}
952
953func TestNewSetStructure(t *testing.T) {
954 // expect error
955 opts := config.DefaultOptions
956 opts.DirPath = "" // the cause of error
957 setDB, err := NewSetStructure(opts)
958 assert.NotNil(t, err)
959 assert.Nil(t, setDB)
960 // expect no error
961 opts = config.DefaultOptions
962 dir, _ := os.MkdirTemp("", "TestSetStructure")
963 opts.DirPath = dir
964 setDB, _ = NewSetStructure(opts)
965 assert.NotNil(t, setDB)
966 assert.IsType(t, &engine.DB{}, setDB.db)
967}
968
969func TestSetStructure_exists(t *testing.T) {
970 tests := []struct {

Callers

nothing calls this directly

Calls 1

NewSetStructureFunction · 0.85

Tested by

no test coverage detected