Пример #1
0
func compareFragment(fragment1 *gauge_messages.Fragment, fragment2 *gauge_messages.Fragment, c *C) {
	c.Assert(fragment1.GetFragmentType(), Equals, fragment2.GetFragmentType())
	c.Assert(fragment1.GetText(), Equals, fragment2.GetText())
	parameter1 := fragment1.GetParameter()
	parameter2 := fragment2.GetParameter()
	compareParameter(parameter1, parameter2, c)
}
Пример #2
0
func makeFragmentCopy(fragment *gauge_messages.Fragment) *gauge_messages.Fragment {
	if fragment.GetFragmentType() == gauge_messages.Fragment_Text {
		return &gauge_messages.Fragment{FragmentType: gauge_messages.Fragment_Text.Enum(), Text: proto.String(fragment.GetText())}
	} else {
		return &gauge_messages.Fragment{FragmentType: gauge_messages.Fragment_Parameter.Enum(), Parameter: makeParameterCopy(fragment.Parameter)}
	}
}