コード例 #1
0
ファイル: build_test.go プロジェクト: niemeyer/snapd
func (s *BuildTestSuite) TestExcludeDynamicWeirdRegexps(c *C) {
	basedir := c.MkDir()
	c.Assert(ioutil.WriteFile(filepath.Join(basedir, ".snapignore"), []byte("*hello\n"), 0644), IsNil)
	// note "*hello" is not a valid regexp, so will be taken literally (not globbed!)
	c.Check(snaptest.ShouldExcludeDynamic(basedir, "ahello"), Equals, false)
	c.Check(snaptest.ShouldExcludeDynamic(basedir, "*hello"), Equals, true)
}
コード例 #2
0
ファイル: build_test.go プロジェクト: niemeyer/snapd
func (s *BuildTestSuite) TestExcludeDynamicWorksIfSnapignore(c *C) {
	basedir := c.MkDir()
	c.Assert(ioutil.WriteFile(filepath.Join(basedir, ".snapignore"), []byte("foo\nb.r\n"), 0644), IsNil)
	c.Check(snaptest.ShouldExcludeDynamic(basedir, "foo"), Equals, true)
	c.Check(snaptest.ShouldExcludeDynamic(basedir, "bar"), Equals, true)
	c.Check(snaptest.ShouldExcludeDynamic(basedir, "bzr"), Equals, true)
	c.Check(snaptest.ShouldExcludeDynamic(basedir, "baz"), Equals, false)
}
コード例 #3
0
ファイル: build_test.go プロジェクト: niemeyer/snapd
func (s *BuildTestSuite) TestExcludeDynamicFalseIfNoSnapignore(c *C) {
	basedir := c.MkDir()
	c.Check(snaptest.ShouldExcludeDynamic(basedir, "foo"), Equals, false)
}