Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostiam committed Sep 6, 2023
1 parent e7996d6 commit 1fb1af8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions testdata/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ func testInvalid(t *proto.Test) {

ems := t.RepeatedEmbeddeds // want "proto field read without getter:"
_ = ems[len(ems)-1].S // want "proto field read without getter:"

ch := make(chan string)
ch <- t.S // want "proto field read without getter:"

for _, v := range t.RepeatedEmbeddeds { // want "proto field read without getter:"
_ = v
}
}

func testValid(t *proto.Test) {
Expand Down Expand Up @@ -121,4 +128,7 @@ func testValid(t *proto.Test) {

ems := t.GetRepeatedEmbeddeds()
_ = ems[len(ems)-1].GetS()

ch := make(chan string)
ch <- t.GetS()
}
10 changes: 10 additions & 0 deletions testdata/test.go.golden
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ func testInvalid(t *proto.Test) {

ems := t.GetRepeatedEmbeddeds() // want "proto field read without getter:"
_ = ems[len(ems)-1].GetS() // want "proto field read without getter:"

ch := make(chan string)
ch <- t.GetS() // want "proto field read without getter:"

for _, v := range t.GetRepeatedEmbeddeds() { // want "proto field read without getter:"
_ = v
}
}

func testValid(t *proto.Test) {
Expand Down Expand Up @@ -121,4 +128,7 @@ func testValid(t *proto.Test) {

ems := t.GetRepeatedEmbeddeds()
_ = ems[len(ems)-1].GetS()

ch := make(chan string)
ch <- t.GetS()
}

0 comments on commit 1fb1af8

Please sign in to comment.