You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
341 B
Go
20 lines
341 B
Go
package shrty
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestOpen(t *testing.T) {
|
|
s, err := Open(path)
|
|
defer os.Remove(path)
|
|
|
|
expected := DB{Path: "short_test.db",
|
|
Store: Store{Token: make(map[string]*Data), Url: make(map[string]string)},
|
|
}
|
|
|
|
assert.NoError(t, err)
|
|
assert.Equal(t, &expected, s)
|
|
}
|