badguardhome/internal/storage/logs/shape_test.go

26 lines
494 B
Go

package logfile
import (
"testing"
)
func TestDatabaseWrite(t *testing.T) {
cases := []string{"280312038j1203j8120938j120938120938d12903h1207h13926410327h46012346073",
"google.com",
"localhost",
"some.weird.absodas"}
var sb = new(ShapeBlock)
err := sb.Open("shapes.db")
if err != nil {
t.Fatal("failed to open db")
}
hshs := make([][]byte, len(cases))
for i, c := range cases {
hshs[i], err = sb.Add([]byte(c))
if err != nil {
t.Fatalf("failed to add %s", c)
}
}
}