Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
arkadiuszos4chain committed Aug 22, 2024
1 parent 9f072b1 commit 8bd60ed
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/moq/moq_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,12 @@ func TestMockGolden(t *testing.T) {
interfaces: []string{"ResetStore"},
goldenFile: filepath.Join("testpackages/withresets", "withresets_moq.golden.go"),
},
{
name: "RangeNumber",
cfg: Config{SrcDir: "testpackages/rangenum"},
interfaces: []string{"Magician"},
goldenFile: filepath.Join("testpackages/rangenum", "rangenum_moq.golden.go"),
},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
Expand Down
13 changes: 13 additions & 0 deletions pkg/moq/testpackages/rangenum/rangenum.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package rangenum

import "fmt"

func DoMagic() {

Check failure on line 5 in pkg/moq/testpackages/rangenum/rangenum.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, oldstable)

exported function DoMagic should have comment or be unexported

Check failure on line 5 in pkg/moq/testpackages/rangenum/rangenum.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, stable)

exported function DoMagic should have comment or be unexported
for range 10 {
fmt.Println("abrakadabra")
}
}

type Magician interface {

Check failure on line 11 in pkg/moq/testpackages/rangenum/rangenum.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, oldstable)

exported type Magician should have comment or be unexported

Check failure on line 11 in pkg/moq/testpackages/rangenum/rangenum.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, stable)

exported type Magician should have comment or be unexported
DoMagic()
}
67 changes: 67 additions & 0 deletions pkg/moq/testpackages/rangenum/rangenum_moq.golden.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8bd60ed

Please sign in to comment.