Skip to content

Commit b028b80

Browse files
Fixes go router unit test
1 parent 72d9fc9 commit b028b80

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

samples/server/petstore/go-api-server/samples_tests/routers_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package main
22

33
import (
4-
"testing"
54
"strings"
5+
"testing"
66

77
"github.com/GIT_USER_ID/GIT_REPO_ID/samples_tests/utils"
88
)
@@ -14,8 +14,9 @@ func Test_Routers(t *testing.T) {
1414
filepath := "../go/routers.go"
1515

1616
expected := ("type Route struct {\n" +
17-
"\tMethod\t string\n" +
18-
"\tPattern\t string\n" +
17+
"\tName string\n" +
18+
"\tMethod string\n" +
19+
"\tPattern string\n" +
1920
"\tHandlerFunc http.HandlerFunc\n" +
2021
"}")
2122

@@ -31,8 +32,8 @@ func Test_Routers(t *testing.T) {
3132
lines := utils.ReadLines(filepath)
3233
expected := "type Routes map[string]Route"
3334

34-
if lines[25] != expected {
35-
t.Errorf("Expected '%s', but got '%s'", expected, lines[25])
35+
if lines[26] != expected {
36+
t.Errorf("Expected '%s', but got '%s'", expected, lines[26])
3637
}
3738
})
3839
}

0 commit comments

Comments
 (0)