本文整理匯總了Golang中github.com/getgauge/gauge/gauge.ConceptDictionary.Search方法的典型用法代碼示例。如果您正苦於以下問題:Golang ConceptDictionary.Search方法的具體用法?Golang ConceptDictionary.Search怎麽用?Golang ConceptDictionary.Search使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/getgauge/gauge/gauge.ConceptDictionary
的用法示例。
在下文中一共展示了ConceptDictionary.Search方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: checkCircularReferencing
func checkCircularReferencing(conceptDictionary *gauge.ConceptDictionary, concept *gauge.Step, traversedSteps map[string]string) *ParseError {
if traversedSteps == nil {
traversedSteps = make(map[string]string, 0)
}
currentConceptFileName := conceptDictionary.Search(concept.Value).FileName
traversedSteps[concept.Value] = currentConceptFileName
for _, step := range concept.ConceptSteps {
if fileName, exists := traversedSteps[step.Value]; exists {
return &ParseError{LineNo: step.LineNo,
Message: fmt.Sprintf("%s: The concept \"%s\" references a higher concept > %s: \"%s\"", currentConceptFileName, concept.LineText, fileName, step.LineText),
}
}
if step.IsConcept {
if err := checkCircularReferencing(conceptDictionary, step, traversedSteps); err != nil {
return err
}
}
}
delete(traversedSteps, concept.Value)
return nil
}
示例2: processConceptStep
func processConceptStep(spec *gauge.Specification, step *gauge.Step, conceptDictionary *gauge.ConceptDictionary) {
if conceptFromDictionary := conceptDictionary.Search(step.Value); conceptFromDictionary != nil {
createConceptStep(spec, conceptFromDictionary.ConceptStep, step)
}
}