AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
~~~ package chainofresponsibility import ( "testing" ) func TestChainOfResponsibility(t *testing.T) { ca := NewConcreteHandlerA() cb := NewConcreteHandlerB() ca.SetSuccessor(cb) var req = [][]int{{1, constHandlerA}, {4, constHandlerA}, {11, constHandlerB}, {0, constHandler}} for _, val := range req { if val[1] != ca.HandleRequest(val[0]) { t.Error("错误") } } } ~~~