Skip to content

Commit d4a2f4a

Browse files
Fix assertion to compare pointer addresses in tests
Updates assertions in unit tests to compare pointer addresses instead of values, ensuring correct validation of object independence. This improves test accuracy by explicitly verifying that cloned or derived objects are distinct in memory.
1 parent 4094d66 commit d4a2f4a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

server/pkg/id/plugin_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ func TestPluginID_Clone(t *testing.T) {
355355
c := p.Clone()
356356

357357
assert.Equal(t, p, c)
358-
assert.NotSame(t, p, c)
358+
assert.NotSame(t, &p, &c)
359359
}
360360

361361
func TestPluginID_Name(t *testing.T) {
@@ -376,7 +376,7 @@ func TestPluginID_Scene(t *testing.T) {
376376
scene: &scene,
377377
}.Scene()
378378
assert.Equal(t, scene, *sid)
379-
assert.NotSame(t, scene, *sid)
379+
assert.NotSame(t, &scene, sid)
380380
}
381381

382382
func TestPluginID_System(t *testing.T) {

0 commit comments

Comments
 (0)