mirror of
https://github.com/restic/restic.git
synced 2026-08-21 13:03:25 +00:00
features: add tests
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package feature_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/restic/restic/internal/feature"
|
||||
rtest "github.com/restic/restic/internal/test"
|
||||
)
|
||||
|
||||
func TestSetFeatureFlag(t *testing.T) {
|
||||
flags := buildTestFlagSet()
|
||||
rtest.Assert(t, !flags.Enabled(alpha), "expected alpha feature to be disabled")
|
||||
|
||||
restore := feature.TestSetFlag(t, flags, alpha, true)
|
||||
rtest.Assert(t, flags.Enabled(alpha), "expected alpha feature to be enabled")
|
||||
|
||||
restore()
|
||||
rtest.Assert(t, !flags.Enabled(alpha), "expected alpha feature to be disabled again")
|
||||
}
|
||||
Reference in New Issue
Block a user