gitlab.com/evatix-go/core@v1.3.55/tests/integratedtests/chmodhelpertests/PartialRwxVerify_test.go (about)

     1  package chmodhelpertests
     2  
     3  import (
     4  	"fmt"
     5  	"testing"
     6  
     7  	. "github.com/smartystreets/goconvey/convey"
     8  
     9  	"gitlab.com/evatix-go/core/chmodhelper"
    10  	"gitlab.com/evatix-go/core/errcore"
    11  	"gitlab.com/evatix-go/core/tests/testwrappers/chmodhelpertestwrappers"
    12  )
    13  
    14  func Test_PartialRwxVerify(t *testing.T) {
    15  	for i, testCase := range chmodhelpertestwrappers.PartialRwxVerifyTestCases {
    16  		Convey(testCase.Header, t, func() {
    17  			// Arrange
    18  			rwx, err := chmodhelper.NewRwxVariableWrapper(testCase.PartialRwxInput1)
    19  			errcore.SimpleHandleErr(err, "rwxVar create failed.")
    20  
    21  			// Act
    22  			actual := rwx.IsEqualPartialRwxPartial(testCase.FullRwxVerifyInput2)
    23  
    24  			// Assert
    25  			if actual != testCase.IsMatchesExpectation {
    26  				fmt.Println("Input 1 :", testCase.PartialRwxInput1)
    27  				fmt.Println("Input 2 :", testCase.FullRwxVerifyInput2)
    28  				fmt.Println(testCase.Header, " --- Failed. Index :", i)
    29  			}
    30  
    31  			So(actual, ShouldEqual, testCase.IsMatchesExpectation)
    32  		})
    33  	}
    34  }