Skip to content

Commit 8e11b5c

Browse files
committed
Remove test dependency on the protobuf library; it is unneeded. (The protobuf
library is still a transitive dependency, via transformer/request/request.pb.go and vendor/github/ampproject/amphtml/validator/validator.pb.go.) PiperOrigin-RevId: 245434613
1 parent ab46a86 commit 8e11b5c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

transformer/internal/htmlnode/htmlnode_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"strings"
1919
"testing"
2020

21-
"github.com/golang/protobuf/proto"
2221
"golang.org/x/net/html/atom"
2322
"golang.org/x/net/html"
2423
)
@@ -43,6 +42,8 @@ const htmltext = `
4342
</html>
4443
`
4544

45+
func stringPtr(v string) *string { return &v }
46+
4647
// Tests a bunch of different methods on the test HTML.
4748
func TestHTMLNode(t *testing.T) {
4849
doc, err := html.Parse(strings.NewReader(htmltext))
@@ -140,9 +141,9 @@ func TestGetAttributeValOrNil(t *testing.T) {
140141
namespace string
141142
expected *string
142143
}{
143-
{Element("p", html.Attribute{Namespace: "foo", Key: "id", Val: "A"}), "foo", proto.String("A")},
144+
{Element("p", html.Attribute{Namespace: "foo", Key: "id", Val: "A"}), "foo", stringPtr("A")},
144145
{Element("p", html.Attribute{Namespace: "foo", Key: "id", Val: "A"}), "differentnamespace", nil},
145-
{Element("p", html.Attribute{Key: "id", Val: "A"}), "", proto.String("A")},
146+
{Element("p", html.Attribute{Key: "id", Val: "A"}), "", stringPtr("A")},
146147
{Element("p"), "", nil},
147148
}
148149
for _, tc := range testCases {

0 commit comments

Comments
 (0)