本文整理匯總了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
}
示例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}
}
示例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
}
示例4: getStepValueFor
func (agent *rephraseRefactorer) getStepValueFor(step *parser.Step, stepName string) (*parser.StepValue, error) {
return parser.ExtractStepValueAndParams(stepName, false)
}