示例#1
0
func Test_Run_rejects_non_pointer_channel(t *testing.T) {
	var out chan Person
	err := junction.Validate(out, nil)

	if err == nil {
		t.Error("Expected error, got nil")
	}
}
示例#2
0
func Test_Run_rejects_pointer_to_non_chan(t *testing.T) {
	var out string
	err := junction.Validate(&out, nil)

	if err == nil {
		t.Error("Expected error, got nil")
	}
}
示例#3
0
func Test_Junction_rejects_non_pointer_model(t *testing.T) {
	var out chan Person
	err := junction.Validate(&out, []junction.Source{{
		Input:  make(chan string),
		Model:  Person{}, // this won't fly
		Update: (*Person).SetName,
	}})

	if err == nil {
		t.Error("Expected error, got nil")
	}
}