|
| 1 | +package pro |
| 2 | + |
| 3 | +import ( |
| 4 | + "testing" |
| 5 | + |
| 6 | + "github.com/stretchr/testify/assert" |
| 7 | +) |
| 8 | + |
| 9 | +// TestUnitShouldWarnRedis8Modules_Redis8WithModules tests that warning is triggered for Redis 8.0 with modules |
| 10 | +func TestUnitShouldWarnRedis8Modules_Redis8WithModules(t *testing.T) { |
| 11 | + result := shouldWarnRedis8Modules("8.0", true) |
| 12 | + assert.True(t, result, "should warn for Redis 8.0 with modules") |
| 13 | +} |
| 14 | + |
| 15 | +// TestUnitShouldWarnRedis8Modules_Redis80WithModules tests that warning is triggered for Redis 8.0.0 with modules |
| 16 | +func TestUnitShouldWarnRedis8Modules_Redis80WithModules(t *testing.T) { |
| 17 | + result := shouldWarnRedis8Modules("8.0.0", true) |
| 18 | + assert.True(t, result, "should warn for Redis 8.0.0 with modules") |
| 19 | +} |
| 20 | + |
| 21 | +// TestUnitShouldWarnRedis8Modules_Redis81WithModules tests that warning is triggered for Redis 8.1+ with modules |
| 22 | +func TestUnitShouldWarnRedis8Modules_Redis81WithModules(t *testing.T) { |
| 23 | + result := shouldWarnRedis8Modules("8.1.0", true) |
| 24 | + assert.True(t, result, "should warn for Redis 8.1.0 with modules") |
| 25 | +} |
| 26 | + |
| 27 | +// TestUnitShouldWarnRedis8Modules_Redis89WithModules tests that warning is triggered for Redis 8.9+ with modules |
| 28 | +func TestUnitShouldWarnRedis8Modules_Redis89WithModules(t *testing.T) { |
| 29 | + result := shouldWarnRedis8Modules("8.9.9", true) |
| 30 | + assert.True(t, result, "should warn for Redis 8.9.9 with modules") |
| 31 | +} |
| 32 | + |
| 33 | +// TestUnitShouldWarnRedis8Modules_Redis7WithModules tests that no warning for Redis 7.x with modules |
| 34 | +func TestUnitShouldWarnRedis8Modules_Redis7WithModules(t *testing.T) { |
| 35 | + result := shouldWarnRedis8Modules("7.4", true) |
| 36 | + assert.False(t, result, "should not warn for Redis 7.4 with modules") |
| 37 | +} |
| 38 | + |
| 39 | +// TestUnitShouldWarnRedis8Modules_Redis6WithModules tests that no warning for Redis 6.x with modules |
| 40 | +func TestUnitShouldWarnRedis8Modules_Redis6WithModules(t *testing.T) { |
| 41 | + result := shouldWarnRedis8Modules("6.2", true) |
| 42 | + assert.False(t, result, "should not warn for Redis 6.2 with modules") |
| 43 | +} |
| 44 | + |
| 45 | +// TestUnitShouldWarnRedis8Modules_Redis8NoModules tests that no warning for Redis 8.0 without modules |
| 46 | +func TestUnitShouldWarnRedis8Modules_Redis8NoModules(t *testing.T) { |
| 47 | + result := shouldWarnRedis8Modules("8.0", false) |
| 48 | + assert.False(t, result, "should not warn for Redis 8.0 without modules") |
| 49 | +} |
| 50 | + |
| 51 | +// TestUnitShouldWarnRedis8Modules_Redis7NoModules tests that no warning for Redis 7.x without modules |
| 52 | +func TestUnitShouldWarnRedis8Modules_Redis7NoModules(t *testing.T) { |
| 53 | + result := shouldWarnRedis8Modules("7.4", false) |
| 54 | + assert.False(t, result, "should not warn for Redis 7.4 without modules") |
| 55 | +} |
| 56 | + |
| 57 | +// TestUnitShouldWarnRedis8Modules_Redis9WithModules tests that warning is triggered for Redis 9.x with modules (future-proofing) |
| 58 | +func TestUnitShouldWarnRedis8Modules_Redis9WithModules(t *testing.T) { |
| 59 | + result := shouldWarnRedis8Modules("9.0", true) |
| 60 | + assert.True(t, result, "should warn for Redis 9.0 with modules (modules bundled in 8.0+)") |
| 61 | +} |
| 62 | + |
| 63 | +// TestUnitShouldWarnRedis8Modules_Redis10WithModules tests that warning is triggered for Redis 10.x with modules |
| 64 | +func TestUnitShouldWarnRedis8Modules_Redis10WithModules(t *testing.T) { |
| 65 | + result := shouldWarnRedis8Modules("10.0.0", true) |
| 66 | + assert.True(t, result, "should warn for Redis 10.0.0 with modules (modules bundled in 8.0+)") |
| 67 | +} |
0 commit comments