func (filter *ScenarioFilterBasedOnTags) Filter(item gauge.Item) bool { if item.Kind() == gauge.ScenarioKind { tags := item.(*gauge.Scenario).Tags if tags == nil { return !filter.filterTags(filter.specTags) } return !filter.filterTags(append(tags.Values, filter.specTags...)) } return false }
func (filter *scenarioIndexFilterToRetain) Filter(item gauge.Item) bool { if item.Kind() == gauge.ScenarioKind { if filter.currentScenarioIndex != filter.indexToNotFilter { filter.currentScenarioIndex++ return true } else { filter.currentScenarioIndex++ return false } } return false }
func (e *specExecutor) resolveToProtoItem(item gauge.Item) *gauge_messages.ProtoItem { var protoItem *gauge_messages.ProtoItem switch item.Kind() { case gauge.StepKind: if (item.(*gauge.Step)).IsConcept { concept := item.(*gauge.Step) protoItem = e.resolveToProtoConceptItem(*concept) } else { protoItem = e.resolveToProtoStepItem(item.(*gauge.Step)) } break default: protoItem = gauge.ConvertToProtoItem(item) } return protoItem }
func formatItem(item gauge.Item) string { switch item.Kind() { case gauge.CommentKind: comment := item.(*gauge.Comment) if comment.Value == "\n" { return comment.Value } return fmt.Sprintf("%s\n", comment.Value) case gauge.StepKind: step := item.(*gauge.Step) return FormatStep(step) case gauge.DataTableKind: dataTable := item.(*gauge.DataTable) return FormatTable(&dataTable.Table) case gauge.TagKind: tags := item.(*gauge.Tags) return FormatTags(tags) } return "" }