@@ -10,6 +10,7 @@ import (
1010 c "git.tcp.direct/kayos/common/entropy"
1111 "github.com/davecgh/go-spew/spew"
1212
13+ "git.tcp.direct/tcp.direct/database"
1314 "git.tcp.direct/tcp.direct/database/kv"
1415)
1516
@@ -111,7 +112,7 @@ func Test_Search(t *testing.T) {
111112 db .store ["yeet" ] = & Store {Bitcask : nil }
112113 t .Run ("BasicSearch" , func (t * testing.T ) {
113114 t .Logf ("executing search for %s" , needle )
114- resChan , errChan := db .With (storename ).Search (needle )
115+ resChan , errChan := db .With (storename ).(database. Store ). Search (needle )
115116 var keys = []int {one , two , three , four , five }
116117 var needed = len (keys )
117118
@@ -146,7 +147,7 @@ func Test_Search(t *testing.T) {
146147 bogus := c .RandStr (55 )
147148 t .Logf ("executing search for %s" , bogus )
148149 var results []kv.KeyValue
149- resChan , errChan := db .With (storename ).Search (bogus )
150+ resChan , errChan := db .With (storename ).(database. Store ). Search (bogus )
150151 select {
151152 case err := <- errChan :
152153 t .Errorf ("failed to search: %s" , err .Error ())
@@ -170,7 +171,7 @@ func Test_ValueExists(t *testing.T) {
170171 needles := addJunk (db , storename , c .RNG (100 ), c .RNG (100 ), c .RNG (100 ), c .RNG (100 ), c .RNG (100 ), t , true )
171172
172173 for _ , ndl := range needles {
173- k , exists := db .With (storename ).ValueExists (ndl )
174+ k , exists := db .With (storename ).(database. Store ). ValueExists (ndl )
174175 if ! exists {
175176 t .Fatalf ("[FAIL] store should have contained a value %s somewhere, it did not." , string (ndl ))
176177 }
@@ -189,7 +190,7 @@ func Test_ValueExists(t *testing.T) {
189190 t .Run ("ValueShouldNotExist" , func (t * testing.T ) {
190191 for n := 0 ; n != 5 ; n ++ {
191192 garbage := c .RandStr (55 )
192- if _ , exists := db .With (storename ).ValueExists ([]byte (garbage )); exists {
193+ if _ , exists := db .With (storename ).(database. Store ). ValueExists ([]byte (garbage )); exists {
193194 t .Errorf ("[FAIL] store should have not contained value %v, but it did" , []byte (garbage ))
194195 } else {
195196 t .Logf ("[SUCCESS] store succeeded in not having random value %s" , garbage )
@@ -200,7 +201,7 @@ func Test_ValueExists(t *testing.T) {
200201 t .Run ("ValueExistNilBitcask" , func (t * testing.T ) {
201202 db .store ["asdb" ] = & Store {Bitcask : nil }
202203 garbage := "yeet"
203- if _ , exists := db .With (storename ).ValueExists ([]byte (garbage )); exists {
204+ if _ , exists := db .With (storename ).(database. Store ). ValueExists ([]byte (garbage )); exists {
204205 t .Errorf ("[FAIL] store should have not contained value %v, should have been nil" , []byte (garbage ))
205206 } else {
206207 t .Log ("[SUCCESS] store succeeded in being nil" )
@@ -227,7 +228,7 @@ func Test_PrefixScan(t *testing.T) {
227228 t .Logf ("added needle with key(value): %s(%s)" , combo .Key .String (), combo .Value .String ())
228229 }
229230 }
230- resChan , errChan := db .With (storename ).PrefixScan ("user:" )
231+ resChan , errChan := db .With (storename ).(database. Store ). PrefixScan ("user:" )
231232 var results []kv.KeyValue
232233 for keyValue := range resChan {
233234 results = append (results , keyValue )
0 commit comments