Skip to content

Commit

Permalink
Merge pull request #23 from ovechkin-dm/22-problems-using-arrays-as-p…
Browse files Browse the repository at this point in the history
…arameters

fix frame pointer offset
  • Loading branch information
ovechkin-dm authored Sep 13, 2023
2 parents fbe0025 + a5d7c5d commit b1cb13b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
module github.com/ovechkin-dm/mockio

go 1.20
go 1.21

require (
github.com/ovechkin-dm/go-dyno v0.0.12
github.com/ovechkin-dm/go-dyno v0.0.14
github.com/timandy/routine v1.1.1
)


8 changes: 6 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/ovechkin-dm/go-dyno v0.0.12 h1:FSFntI2sOnQGzZr09jsYyW+pzMewifjscPorzAiDXLs=
github.com/ovechkin-dm/go-dyno v0.0.12/go.mod h1:06OT6ztP0Y4rO1lXEn3oB2u/ErA5dxCCjkEpa54L5Jw=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/ovechkin-dm/go-dyno v0.0.14 h1:PqcZ1xWJCd6nWdkIRRdU4IyUdDlA5bjfJKSGXnM9seA=
github.com/ovechkin-dm/go-dyno v0.0.14/go.mod h1:CcJNuo7AbePMoRNpM3i1jC1Rp9kHEMyWozNdWzR+0ys=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/timandy/routine v1.1.1 h1:6/Z7qLFZj3GrzuRksBFzIG8YGUh8CLhjnnMePBQTrEI=
github.com/timandy/routine v1.1.1/go.mod h1:OZHPOKSvqL/ZvqXFkNZyit0xIVelERptYXdAHH00adQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
23 changes: 23 additions & 0 deletions tests/mocking/mock_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package mocking

import (
"fmt"
. "github.com/ovechkin-dm/mockio/mock"
"github.com/ovechkin-dm/mockio/tests/common"
"testing"
)

type ByteArrInterface interface {
DoSomething(b [16]byte) string
}

func TestByteArrayArgs(t *testing.T) {
r := common.NewMockReporter(t)
SetUp(r)
myMock := Mock[ByteArrInterface]()
myBytes := [16]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}

WhenSingle(myMock.DoSomething(myBytes)).ThenReturn("test")
result := myMock.DoSomething(myBytes)
fmt.Println(result)
}

0 comments on commit b1cb13b

Please sign in to comment.