當前位置: 首頁>>代碼示例>>Golang>>正文


Golang gauge_messages.Step類代碼示例

本文整理匯總了Golang中github.com/getgauge/gauge/gauge_messages.Step的典型用法代碼示例。如果您正苦於以下問題:Golang Step類的具體用法?Golang Step怎麽用?Golang Step使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Step類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: handleTable

func (self *extractor) handleTable(stepInConcept *parser.Step, step *gauge_messages.Step) {
	stepInConcept.Value += " {}"
	specText := self.fileContent + step.GetTable()
	spec, result := new(parser.SpecParser).Parse(specText, &parser.ConceptDictionary{})
	if !result.Ok {
		self.errors = append(self.errors, result.ParseError)
		return
	}
	stepArgs := []*parser.StepArg{spec.Scenarios[0].Steps[0].Args[0]}
	self.addTableAsParam(step, stepArgs)
	stepInConcept.Args = append(stepInConcept.Args, stepArgs[0])
}
開發者ID:andrewmkrug,項目名稱:gauge,代碼行數:12,代碼來源:concept_extractor.go

示例2: getExtractedConcept

func getExtractedConcept(conceptName *gauge_messages.Step, steps []*gauge_messages.Step, content string) (string, string, error) {
	tokens, _ := new(parser.SpecParser).GenerateTokens("* " + conceptName.GetName())
	conceptStep, _ := (&parser.Specification{}).CreateStepUsingLookup(tokens[0], nil)
	specText, err := getContentWithDataTable(content)
	if err != nil {
		return "", "", err
	}
	extractor := &extractor{conceptName: "* " + conceptName.GetName(), stepsInConcept: "", stepsToExtract: steps, conceptStep: conceptStep, table: &parser.Table{}, fileContent: specText, errors: make([]error, 0)}
	extractor.extractSteps()
	if len(extractor.errors) != 0 {
		return "", "", err
	}
	conceptStep.ReplaceArgsWithDynamic(conceptStep.Args)
	addArgsFromTable(conceptStep, &extractor.conceptName, extractor.dynamicArgs)
	if extractor.table.IsInitialized() {
		extractor.conceptName += "\n" + formatter.FormatTable(extractor.table)
	}
	return strings.Replace(formatter.FormatStep(conceptStep), "* ", "# ", 1) + (extractor.stepsInConcept), extractor.conceptName, nil
}
開發者ID:andrewmkrug,項目名稱:gauge,代碼行數:19,代碼來源:concept_extractor.go

示例3: addTableAsParam

func (self *extractor) addTableAsParam(step *gauge_messages.Step, args []*parser.StepArg) {
	if step.GetParamTableName() != "" {
		self.conceptName = strings.Replace(self.conceptName, fmt.Sprintf("<%s>", step.GetParamTableName()), "", 1)
		self.table = &args[0].Table
		args[0] = &parser.StepArg{Value: step.GetParamTableName(), ArgType: parser.Dynamic}
	} else {
		self.dynamicArgs = append(self.dynamicArgs, (&args[0].Table).GetDynamicArgs()...)
	}
}
開發者ID:andrewmkrug,項目名稱:gauge,代碼行數:9,代碼來源:concept_extractor.go


注:本文中的github.com/getgauge/gauge/gauge_messages.Step類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。