Skip to content

Commit 63ac35b

Browse files
test: expose skip helpers
SkipIfLess and SkipIfGreaterOrEqual are useful to build custom skip conditions in subpackage. Part of #215
1 parent 114bdf1 commit 63ac35b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test_helpers/utils.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func SkipIfSQLUnsupported(t testing.TB) {
7575
}
7676
}
7777

78-
func skipIfLess(t *testing.T, feature string, major, minor, patch uint64) {
78+
func SkipIfLess(t *testing.T, feature string, major, minor, patch uint64) {
7979
t.Helper()
8080

8181
isLess, err := IsTarantoolVersionLess(major, minor, patch)
@@ -88,7 +88,7 @@ func skipIfLess(t *testing.T, feature string, major, minor, patch uint64) {
8888
}
8989
}
9090

91-
func skipIfGreaterOrEqual(t *testing.T, feature string, major, minor, patch uint64) {
91+
func SkipIfGreaterOrEqual(t *testing.T, feature string, major, minor, patch uint64) {
9292
t.Helper()
9393

9494
isLess, err := IsTarantoolVersionLess(major, minor, patch)
@@ -106,31 +106,31 @@ func skipIfGreaterOrEqual(t *testing.T, feature string, major, minor, patch uint
106106
func SkipIfStreamsUnsupported(t *testing.T) {
107107
t.Helper()
108108

109-
skipIfLess(t, "streams", 2, 10, 0)
109+
SkipIfLess(t, "streams", 2, 10, 0)
110110
}
111111

112112
// SkipOfStreamsUnsupported skips test run if Tarantool without watchers
113113
// support is used.
114114
func SkipIfWatchersUnsupported(t *testing.T) {
115115
t.Helper()
116116

117-
skipIfLess(t, "watchers", 2, 10, 0)
117+
SkipIfLess(t, "watchers", 2, 10, 0)
118118
}
119119

120120
// SkipIfWatchersSupported skips test run if Tarantool with watchers
121121
// support is used.
122122
func SkipIfWatchersSupported(t *testing.T) {
123123
t.Helper()
124124

125-
skipIfGreaterOrEqual(t, "watchers", 2, 10, 0)
125+
SkipIfGreaterOrEqual(t, "watchers", 2, 10, 0)
126126
}
127127

128128
// SkipIfIdUnsupported skips test run if Tarantool without
129129
// IPROTO_ID support is used.
130130
func SkipIfIdUnsupported(t *testing.T) {
131131
t.Helper()
132132

133-
skipIfLess(t, "id requests", 2, 10, 0)
133+
SkipIfLess(t, "id requests", 2, 10, 0)
134134
}
135135

136136
// SkipIfIdSupported skips test run if Tarantool with
@@ -139,23 +139,23 @@ func SkipIfIdUnsupported(t *testing.T) {
139139
func SkipIfIdSupported(t *testing.T) {
140140
t.Helper()
141141

142-
skipIfGreaterOrEqual(t, "id requests", 2, 10, 0)
142+
SkipIfGreaterOrEqual(t, "id requests", 2, 10, 0)
143143
}
144144

145145
// SkipIfErrorExtendedInfoUnsupported skips test run if Tarantool without
146146
// IPROTO_ERROR (0x52) support is used.
147147
func SkipIfErrorExtendedInfoUnsupported(t *testing.T) {
148148
t.Helper()
149149

150-
skipIfLess(t, "error extended info", 2, 4, 1)
150+
SkipIfLess(t, "error extended info", 2, 4, 1)
151151
}
152152

153153
// SkipIfErrorMessagePackTypeUnsupported skips test run if Tarantool without
154154
// MP_ERROR type over iproto support is used.
155155
func SkipIfErrorMessagePackTypeUnsupported(t *testing.T) {
156156
t.Helper()
157157

158-
skipIfLess(t, "error type in MessagePack", 2, 10, 0)
158+
SkipIfLess(t, "error type in MessagePack", 2, 10, 0)
159159
}
160160

161161
// CheckEqualBoxErrors checks equivalence of tarantool.BoxError objects.

0 commit comments

Comments
 (0)