Skip to content

Commit

Permalink
test: expose skip helpers
Browse files Browse the repository at this point in the history
SkipIfLess and SkipIfGreaterOrEqual are useful to build custom skip
conditions in subpackage.

Part of #215
  • Loading branch information
DifferentialOrange committed Dec 13, 2022
1 parent b86cd63 commit 9fc284e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test_helpers/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func SkipIfSQLUnsupported(t testing.TB) {
}
}

func skipIfLess(t *testing.T, feature string, major, minor, patch uint64) {
func SkipIfLess(t *testing.T, feature string, major, minor, patch uint64) {
t.Helper()

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

func skipIfGreaterOrEqual(t *testing.T, feature string, major, minor, patch uint64) {
func SkipIfGreaterOrEqual(t *testing.T, feature string, major, minor, patch uint64) {
t.Helper()

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

skipIfLess(t, "streams", 2, 10, 0)
SkipIfLess(t, "streams", 2, 10, 0)
}

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

skipIfLess(t, "watchers", 2, 10, 0)
SkipIfLess(t, "watchers", 2, 10, 0)
}

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

skipIfGreaterOrEqual(t, "watchers", 2, 10, 0)
SkipIfGreaterOrEqual(t, "watchers", 2, 10, 0)
}

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

skipIfLess(t, "id requests", 2, 10, 0)
SkipIfLess(t, "id requests", 2, 10, 0)
}

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

skipIfGreaterOrEqual(t, "id requests", 2, 10, 0)
SkipIfGreaterOrEqual(t, "id requests", 2, 10, 0)
}

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

skipIfLess(t, "error extended info", 2, 4, 1)
SkipIfLess(t, "error extended info", 2, 4, 1)
}

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

skipIfLess(t, "error type in MessagePack", 2, 10, 0)
SkipIfLess(t, "error type in MessagePack", 2, 10, 0)
}

// CheckEqualBoxErrors checks equivalence of tarantool.BoxError objects.
Expand Down

0 comments on commit 9fc284e

Please sign in to comment.