/usr/share/gocode/src/github.com/onsi/gomega/gstruct/pointer_test.go is in golang-gomega-dev 1.0+git20160910.d59fa0a-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | package gstruct_test
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gstruct"
)
var _ = Describe("PointTo", func() {
It("should fail when passed nil", func() {
var p *struct{}
Ω(p).Should(BeNil())
})
It("should succeed when passed non-nil pointer", func() {
var s struct{}
Ω(&s).Should(PointTo(Ignore()))
})
It("should unwrap the pointee value", func() {
i := 1
Ω(&i).Should(PointTo(Equal(1)))
Ω(&i).ShouldNot(PointTo(Equal(2)))
})
It("should work with nested pointers", func() {
i := 1
ip := &i
ipp := &ip
Ω(ipp).Should(PointTo(PointTo(Equal(1))))
Ω(ipp).ShouldNot(PointTo(PointTo(Equal(2))))
})
})
|