all: Use new reflect based CLI (#5487)

This commit is contained in:
Audrius Butkevicius
2019-02-12 06:58:24 +00:00
committed by Jakob Borg
parent 7bac927ac8
commit dc929946fe
37 changed files with 944 additions and 1723 deletions

View File

@@ -6,7 +6,28 @@
package config
import "testing"
import (
"testing"
"github.com/syncthing/syncthing/lib/util"
)
type TestStruct struct {
Size Size `default:"10%"`
}
func TestSizeDefaults(t *testing.T) {
x := &TestStruct{}
util.SetDefaults(x)
if !x.Size.Percentage() {
t.Error("not percentage")
}
if x.Size.Value != 10 {
t.Error("not ten")
}
}
func TestParseSize(t *testing.T) {
cases := []struct {