-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpebble_test.go
129 lines (118 loc) · 2.78 KB
/
pebble_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
package pebble
import (
"os"
"runtime"
"testing"
"github.com/benitogf/katamari"
"github.com/benitogf/katamari/messages"
)
var units = []string{
"\xe4\xef\xf0\xe9\xf9l\x100",
"V'\xe4\xc0\xbb>0\x86j",
"0'\xe40\x860",
"\b𝅗𝅝\x85",
"𓏝",
"𝅅",
"'",
"\xd80''",
"\xd8%''",
"0",
"\000",
"",
}
func TestStoragePebble(t *testing.T) {
// https://github.com/golang/go/issues/22553
if runtime.GOOS != "windows" {
t.Parallel()
}
app := &katamari.Server{}
app.Silence = true
app.Storage = &Storage{Path: "test/db"}
app.Start("localhost:0")
defer app.Close(os.Interrupt)
for i := range units {
katamari.StorageListTest(app, t, messages.Encode([]byte(units[i])))
}
katamari.StorageObjectTest(app, t)
}
func TestStreamBroadcastLevel(t *testing.T) {
if runtime.GOOS != "windows" {
t.Parallel()
}
app := katamari.Server{}
app.Silence = true
app.ForcePatch = true
app.Storage = &Storage{Path: "test/db1" + katamari.Time()}
app.Start("localhost:0")
app.Storage.Clear()
defer app.Close(os.Interrupt)
katamari.StreamBroadcastTest(t, &app)
}
func TestStreamGlobBroadcastLevel(t *testing.T) {
if runtime.GOOS != "windows" {
t.Parallel()
}
app := katamari.Server{}
app.Silence = true
app.ForcePatch = true
app.Storage = &Storage{Path: "test/db2" + katamari.Time()}
app.Start("localhost:0")
app.Storage.Clear()
defer app.Close(os.Interrupt)
katamari.StreamGlobBroadcastTest(t, &app)
}
func TestStreamBroadcastFilter(t *testing.T) {
if runtime.GOOS != "windows" {
t.Parallel()
}
app := katamari.Server{}
app.Silence = true
app.ForcePatch = true
app.Storage = &Storage{Path: "test/db3" + katamari.Time()}
defer app.Close(os.Interrupt)
katamari.StreamBroadcastFilterTest(t, &app)
}
func TestGetN(t *testing.T) {
if runtime.GOOS != "windows" {
t.Parallel()
}
app := &katamari.Server{}
app.Silence = true
app.Start("localhost:0")
defer app.Close(os.Interrupt)
katamari.StorageGetNTest(app, t, 20)
}
func TestGetNRange(t *testing.T) {
if runtime.GOOS != "windows" {
t.Parallel()
}
app := &katamari.Server{}
app.Silence = true
app.Start("localhost:0")
defer app.Close(os.Interrupt)
katamari.StorageGetNRangeTest(app, t, 20)
}
func TestKeysRange(t *testing.T) {
if runtime.GOOS != "windows" {
t.Parallel()
}
app := &katamari.Server{}
app.Silence = true
app.Storage = &Storage{Path: "test/db4" + katamari.Time()}
app.Start("localhost:0")
defer app.Close(os.Interrupt)
katamari.StorageKeysRangeTest(app, t, 20)
}
func TestStreamItemGlobBroadcastLevel(t *testing.T) {
if runtime.GOOS != "windows" {
t.Parallel()
}
app := katamari.Server{}
app.Silence = true
app.ForcePatch = true
app.Storage = &Storage{Path: "test/db5" + katamari.Time()}
app.Start("localhost:0")
app.Storage.Clear()
defer app.Close(os.Interrupt)
katamari.StreamItemGlobBroadcastTest(t, &app)
}