コード例 #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)
}