mirror of
https://github.com/rclone/rclone.git
synced 2025-12-30 15:13:55 +00:00
fs: make Flagger and FlaggerNP interfaces public so we can test flags elsewhere
This commit is contained in:
@@ -5,31 +5,14 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/spf13/pflag"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// Interface which flags must satisfy - only defined for _test.go
|
||||
// since we don't want to pull in pflag here
|
||||
type flagger interface {
|
||||
pflag.Value
|
||||
json.Unmarshaler
|
||||
}
|
||||
|
||||
// Interface which non-pointer flags must satisfy
|
||||
//
|
||||
// These are from pflag.Value and need to be non-pointer due the the
|
||||
// way the backend flags are inserted into the flags.
|
||||
type flaggerNP interface {
|
||||
String() string
|
||||
Type() string
|
||||
}
|
||||
|
||||
// Check it satisfies the interfaces
|
||||
var (
|
||||
_ flagger = (*SizeSuffix)(nil)
|
||||
_ flaggerNP = SizeSuffix(0)
|
||||
_ Flagger = (*SizeSuffix)(nil)
|
||||
_ FlaggerNP = SizeSuffix(0)
|
||||
)
|
||||
|
||||
func TestSizeSuffixString(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user