schema_test.go 485 B

123456789101112131415161718
  1. package storage
  2. import (
  3. "github.com/samber/lo"
  4. "github.com/stretchr/testify/assert"
  5. "testing"
  6. )
  7. func TestAppendURLParams(t *testing.T) {
  8. // test windows path
  9. url, err := AppendURLParams(`c:\\sqlite.db`, []lo.Tuple2[string, string]{{"a", "b"}})
  10. assert.NoError(t, err)
  11. assert.Equal(t, `c:\\sqlite.db?a=b`, url)
  12. // test no scheme
  13. url, err = AppendURLParams(`sqlite.db`, []lo.Tuple2[string, string]{{"a", "b"}})
  14. assert.NoError(t, err)
  15. assert.Equal(t, `sqlite.db?a=b`, url)
  16. }