golang 1.5 reference compat issue
Этот коммит содержится в:
родитель
a3ce373a43
коммит
4c0cd750f1
4 изменённых файлов: 31 добавлений и 23 удалений
5
behat.go
Обычный файл
5
behat.go
Обычный файл
|
@ -0,0 +1,5 @@
|
|||
package main
|
||||
|
||||
func main() {
|
||||
|
||||
}
|
23
gherkin/ast_test.go
Обычный файл
23
gherkin/ast_test.go
Обычный файл
|
@ -0,0 +1,23 @@
|
|||
package gherkin
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/l3pp4rd/go-behat/gherkin/lexer"
|
||||
)
|
||||
|
||||
func (a *AST) assertMatchesTypes(expected []lexer.TokenType, t *testing.T) {
|
||||
key := -1
|
||||
for item := a.head; item != nil; item = item.next {
|
||||
key += 1
|
||||
if len(expected) <= key {
|
||||
t.Fatalf("there are more tokens in AST then expected, next is '%s'", item.value.Type)
|
||||
}
|
||||
if expected[key] != item.value.Type {
|
||||
t.Fatalf("expected ast token '%s', but got '%s' at position: %d", expected[key], item.value.Type, key)
|
||||
}
|
||||
}
|
||||
if len(expected)-1 != key {
|
||||
t.Fatalf("expected ast length %d, does not match actual: %d", len(expected), key+1)
|
||||
}
|
||||
}
|
|
@ -168,7 +168,8 @@ func (p *parser) parseFeature() (ft *Feature, err error) {
|
|||
}
|
||||
|
||||
// there may be tags before scenario
|
||||
sc := &Scenario{Tags: ft.Tags}
|
||||
sc := &Scenario{}
|
||||
sc.Tags = append(sc.Tags, ft.Tags...)
|
||||
if tok.Type == lexer.TAGS {
|
||||
for _, t := range p.parseTags() {
|
||||
if !sc.Tags.Has(t) {
|
||||
|
|
|
@ -1,27 +1,6 @@
|
|||
package gherkin
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/l3pp4rd/go-behat/gherkin/lexer"
|
||||
)
|
||||
|
||||
func (a *AST) assertMatchesTypes(expected []lexer.TokenType, t *testing.T) {
|
||||
key := -1
|
||||
for item := a.head; item != nil; item = item.next {
|
||||
key += 1
|
||||
if len(expected) <= key {
|
||||
t.Fatalf("there are more tokens in AST then expected, next is '%s'", item.value.Type)
|
||||
}
|
||||
if expected[key] != item.value.Type {
|
||||
t.Fatalf("expected ast token '%s', but got '%s' at position: %d", expected[key], item.value.Type, key)
|
||||
}
|
||||
}
|
||||
if len(expected)-1 != key {
|
||||
t.Fatalf("expected ast length %d, does not match actual: %d", len(expected), key+1)
|
||||
}
|
||||
}
|
||||
import "strings"
|
||||
|
||||
func indent(n int, s string) string {
|
||||
return strings.Repeat(" ", n) + s
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче