github.com/TeaOSLab/EdgeNode@v1.3.8/internal/utils/dbs/db_test.go (about) 1 // Copyright 2023 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn . 2 3 package dbs_test 4 5 import ( 6 "github.com/TeaOSLab/EdgeNode/internal/utils/dbs" 7 "net/url" 8 "testing" 9 ) 10 11 func TestParseDSN(t *testing.T) { 12 var dsn = "file:/home/cache/p43/.indexes/db-3.db?cache=private&mode=ro&_journal_mode=WAL&_sync=" + dbs.SyncMode + "&_cache_size=88000" 13 u, err := url.Parse(dsn) 14 if err != nil { 15 t.Fatal(err) 16 } 17 t.Log(u.Path) // expect: :/home/cache/p43/.indexes/db-3.db 18 }