示例#1
0
func TestComposeAllComposeAll(t *testing.T) {
	abc := ComposeAll(a, b, c)
	cba := ComposeAll(c, b, a)
	abccba := ComposeAll(abc, cba)

	testutils.RunTest(abccba, "ABCCBA", t)
}
示例#2
0
func TestFold(t *testing.T) {
	testutils.RunTest(fold(Compose, a, []Middleware{b, c}), "ABC", t)
}
示例#3
0
func TestIdCompose(t *testing.T) {
	testutils.RunTest(Id().Compose(a).Compose(b), "AB", t)
}
示例#4
0
func TestCompositionChain(t *testing.T) {
	testutils.RunTest(ComposeAll().Compose(a).Compose(b), "AB", t)
}
示例#5
0
func TestEmptyComposeAll(t *testing.T) {
	testutils.RunTest(ComposeAll(), "", t)
}
示例#6
0
func TestSingleComposeAll(t *testing.T) {
	testutils.RunTest(ComposeAll(a), "A", t)
}
示例#7
0
func TestComposeAll(t *testing.T) {
	testutils.RunTest(ComposeAll(a, b, c), "ABC", t)
}
示例#8
0
func TestCompose(t *testing.T) {
	testutils.RunTest(Compose(a, b), "AB", t)
}