🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

github.com/stretchr/testify

Package Overview
Dependencies
Versions
892
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/stretchr/testify - go Package Compare versions

Comparing version
v1.11.1-0.20250818193004-e581b36d7b36
to
v1.11.1-0.20250825121340-580d80711200
+5
mock/mock_no_objx.go
//go:build testify_no_objx || testify_no_deps
package mock
type testData = struct{}
//go:build !testify_no_objx && !testify_no_deps
package mock
import (
"testing"
"github.com/stretchr/testify/assert"
)
func Test_Mock_TestData(t *testing.T) {
t.Parallel()
var mockedService = new(TestExampleImplementation)
if assert.NotNil(t, mockedService.TestData()) {
mockedService.TestData().Set("something", 123)
assert.Equal(t, 123, mockedService.TestData().Get("something").Data())
}
}
// This source file isolates the uses of the objx module to ease
// maintenance of downstream forks that remove that dependency.
// See https://github.com/stretchr/testify/issues/1752
//go:build !testify_no_objx && !testify_no_deps
package mock
import "github.com/stretchr/objx"
type testData = objx.Map
// TestData holds any data that might be useful for testing. Testify ignores
// this data completely allowing you to do whatever you like with it.
func (m *Mock) TestData() objx.Map {
if m.testData == nil {
m.testData = make(objx.Map)
}
return m.testData
}
+1
-12

@@ -16,3 +16,2 @@ package mock

"github.com/pmezard/go-difflib/difflib"
"github.com/stretchr/objx"

@@ -315,3 +314,3 @@ "github.com/stretchr/testify/assert"

// this data completely allowing you to do whatever you like with it.
testData objx.Map
testData testData

@@ -329,12 +328,2 @@ mutex sync.Mutex

// TestData holds any data that might be useful for testing. Testify ignores
// this data completely allowing you to do whatever you like with it.
func (m *Mock) TestData() objx.Map {
if m.testData == nil {
m.testData = make(objx.Map)
}
return m.testData
}
/*

@@ -341,0 +330,0 @@ Setting expectations

Sorry, the diff of this file is too big to display