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


Golang parser.ExtractStepValueAndParams函數代碼示例

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


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

示例1: getParsedStepValues

func (s *SpecInfoGatherer) getParsedStepValues(steps []string) []*gauge.StepValue {
	stepValues := make([]*gauge.StepValue, 0)
	for _, step := range steps {
		stepValue, err := parser.ExtractStepValueAndParams(step, false)
		if err != nil {
			logger.APILog.Error("Failed to extract stepvalue for step - %s : %s", step, err)
			continue
		}
		stepValues = append(stepValues, stepValue)
	}
	return stepValues
}
開發者ID:0-T-0,項目名稱:gauge,代碼行數:12,代碼來源:specDetails.go

示例2: getStepValueRequestResponse

func (handler *gaugeApiMessageHandler) getStepValueRequestResponse(message *gauge_messages.APIMessage) *gauge_messages.APIMessage {
	request := message.GetStepValueRequest()
	stepText := request.GetStepText()
	hasInlineTable := request.GetHasInlineTable()
	stepValue, err := parser.ExtractStepValueAndParams(stepText, hasInlineTable)

	if err != nil {
		return handler.getErrorResponse(message, err)
	}
	stepValueResponse := &gauge_messages.GetStepValueResponse{StepValue: parser.ConvertToProtoStepValue(stepValue)}
	return &gauge_messages.APIMessage{MessageType: gauge_messages.APIMessage_GetStepValueResponse.Enum(), MessageId: message.MessageId, StepValueResponse: stepValueResponse}

}
開發者ID:krwhitney,項目名稱:gauge,代碼行數:13,代碼來源:api.go

示例3: createRefactorRequest

//Todo: Check for inline tables
func (agent *rephraseRefactorer) createRefactorRequest(runner *runner.TestRunner, stepName string) (*gauge_messages.Message, error) {
	oldStepValue, err := agent.getStepValueFor(agent.oldStep, stepName)
	if err != nil {
		return nil, err
	}
	orderMap := agent.createOrderOfArgs()
	newStepName := agent.generateNewStepName(oldStepValue.Args, orderMap)
	newStepValue, err := parser.ExtractStepValueAndParams(newStepName, false)
	if err != nil {
		return nil, err
	}
	oldProtoStepValue := parser.ConvertToProtoStepValue(oldStepValue)
	newProtoStepValue := parser.ConvertToProtoStepValue(newStepValue)
	return &gauge_messages.Message{MessageType: gauge_messages.Message_RefactorRequest.Enum(), RefactorRequest: &gauge_messages.RefactorRequest{OldStepValue: oldProtoStepValue, NewStepValue: newProtoStepValue, ParamPositions: agent.createParameterPositions(orderMap)}}, nil
}
開發者ID:ranjeet-floyd,項目名稱:gauge,代碼行數:16,代碼來源:refactor.go

示例4: getStepValueFor

func (agent *rephraseRefactorer) getStepValueFor(step *parser.Step, stepName string) (*parser.StepValue, error) {
	return parser.ExtractStepValueAndParams(stepName, false)
}
開發者ID:ranjeet-floyd,項目名稱:gauge,代碼行數:3,代碼來源:refactor.go


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