test with stream
parent
39ddc93e2f
commit
246008d83b
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"local/storage"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
|
@ -12,6 +13,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestLastN(t *testing.T) {
|
func TestLastN(t *testing.T) {
|
||||||
|
for _, storeName := range []string{storage.MAP.String(), storage.MAPSTREAM.String()} {
|
||||||
d, clean := makeJunk(t)
|
d, clean := makeJunk(t)
|
||||||
defer clean()
|
defer clean()
|
||||||
|
|
||||||
|
|
@ -19,7 +21,7 @@ func TestLastN(t *testing.T) {
|
||||||
N: 3,
|
N: 3,
|
||||||
Ns: "b",
|
Ns: "b",
|
||||||
Root: d,
|
Root: d,
|
||||||
Store: "map",
|
Store: storeName,
|
||||||
}
|
}
|
||||||
lastn, err := New(conf)
|
lastn, err := New(conf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -73,6 +75,7 @@ func TestLastN(t *testing.T) {
|
||||||
} else if len(saved) != 11 {
|
} else if len(saved) != 11 {
|
||||||
t.Fatal(len(saved))
|
t.Fatal(len(saved))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeJunk(t *testing.T) (string, func()) {
|
func makeJunk(t *testing.T) (string, func()) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue