github.com/wuhuizuo/gomplate@v3.5.0+incompatible/tests/integration/regexp_test.go (about)

     1  //+build integration
     2  
     3  package integration
     4  
     5  import (
     6  	. "gopkg.in/check.v1"
     7  
     8  	"github.com/gotestyourself/gotestyourself/icmd"
     9  )
    10  
    11  type RegexpSuite struct{}
    12  
    13  var _ = Suite(&RegexpSuite{})
    14  
    15  func (s *RegexpSuite) TestReplace(c *C) {
    16  	result := icmd.RunCommand(GomplateBin, "-i",
    17  		`{{ "1.2.3-59" | regexp.Replace "-([0-9]*)" ".$1" }}`)
    18  	result.Assert(c, icmd.Expected{ExitCode: 0, Out: "1.2.3.59"})
    19  }