func TestLoadWithParsersNoConfigAllDefaultSomeFlag(t *testing.T) {
	// INIT
	config := &Configuration{}
	defaultPointers := newDefaultPointersConfiguration()

	customParsers := map[reflect.Type]parse.Parser{
		reflect.TypeOf([]ServerInfo{}): &sliceServerValue{},
	}

	args := []string{
		"--loglevel=INFO",
		"--db=FALSE",
		"--owner.dob=2016-04-20T17:39:00Z",
	}

	// TEST
	if err := LoadWithParsers(config, defaultPointers, args, customParsers); err != nil {
		t.Fatal(err)
	}

	// CHECK
	check := newDefaultPointersConfiguration()
	check.LogLevel = "INFO"
	check.Db = nil
	check.Owner.DateOfBirth, _ = time.Parse(time.RFC3339, "2016-04-20T17:39:00Z")
	check.Owner.Name = nil

	if !reflect.DeepEqual(config, check) {
		if !reflect.DeepEqual(config.Owner, check.Owner) {
			t.Errorf("\nexpected\t: %+v\ngot\t\t\t: %+v", check.Owner, config.Owner)
		}
		t.Errorf("Error :\nexpected \t%+v \ngot \t\t%+v\n", check, config)
	}
}
// Test LoadWithParsers on empty config with all default values on pointers and with some flags called
Test LoadWithParsers on empty config with all default values on pointers and with some flags called
// Test LoadWithParsers on empty config with all default values on pointers and with some flags called
func TestLoadWithParsersNoConfigAllDefaultSomeFlag(t *testing.T) {
	config := &Configuration{}
	defaultPointers := newDefaultPointersConfiguration()
	customParsers := map[reflect.Type]parse.Parser{
		reflect.TypeOf([]ServerInfo{}): &sliceServerValue{},
	}
	args := []string{
		"--loglevel=INFO",
		"--db=FALSE",
		"--owner.dob=2016-04-20T17:39:00Z",
	}
	if err := LoadWithParsers(config, defaultPointers, args, customParsers); err != nil {
		t.Fatal(err)
	}
	check := newDefaultPointersConfiguration()
	check.LogLevel = "INFO"
	check.Db = nil
	check.Owner.DateOfBirth, _ = time.Parse(time.RFC3339, "2016-04-20T17:39:00Z")
	check.Owner.Name = nil
	if !reflect.DeepEqual(config, check) {
		if !reflect.DeepEqual(config.Owner, check.Owner) {
			t.Errorf("\nexpected\t: %+v\ngot\t\t\t: %+v", check.Owner, config.Owner)
		}
		t.Errorf("Error :\nexpected \t%+v \ngot \t\t%+v\n", check, config)
	}
}
func TestLoadWithParsersNoConfigAllDefaultSomeFlag ( t * testing . T ) { config := & Configuration { } defaultPointers := newDefaultPointersConfiguration ( ) customParsers := map [ reflect . Type ] parse . Parser { reflect . TypeOf ( [ ] ServerInfo { } ) : & sliceServerValue { } , } args := [ ] string { " " , " " , " " , } if err := LoadWithParsers ( config , defaultPointers , args , customParsers ) ; err != nil { t . Fatal ( err ) } check := newDefaultPointersConfiguration ( ) check . LogLevel = " " check . Db = nil check . Owner . DateOfBirth , _ = time . Parse ( time . RFC3339 , " " ) check . Owner . Name = nil if ! reflect . DeepEqual ( config , check ) { if ! reflect . DeepEqual ( config . Owner , check . Owner ) { t . Errorf ( " \n \t \n \t \t \t " , check . Owner , config . Owner ) } t . Errorf ( " \n \t \n \t \t \n " , check , config ) } }
Test LoadWithParsers on empty config with all default values on pointers and with some flags called
Test LoadWithParsers on empty config with all default values on pointers and with some flags called
// INIT // TEST // CHECK