gosec/rules/fileperms_test.go
pro-wh cf63541008
fileperms: bitwise permission comparison (#883)
* fileperms: extract existing mode comparison logic

* fileperms: add failing test

* fileperms: bitwise permission comparison
2022-10-20 08:48:40 +02:00

15 lines
381 B
Go

package rules
import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
var _ = Describe("modeIsSubset", func() {
It("it compares modes correctly", func() {
Expect(modeIsSubset(0o600, 0o600)).To(BeTrue())
Expect(modeIsSubset(0o400, 0o600)).To(BeTrue())
Expect(modeIsSubset(0o644, 0o600)).To(BeFalse())
Expect(modeIsSubset(0o466, 0o600)).To(BeFalse())
})
})