[BACK]Return to path_test.go CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / pkgtools / pkglint / files

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /pkgsrc/pkgtools/pkglint/files/path_test.go between version 1.8 and 1.9

version 1.8, 2020/01/04 19:53:14 version 1.9, 2020/01/18 21:56:09
Line 1234  func (s *Suite) Test_PackagePath_JoinNoC
Line 1234  func (s *Suite) Test_PackagePath_JoinNoC
                 "../../category/package/patches/patch-aa")                  "../../category/package/patches/patch-aa")
 }  }
   
   func (s *Suite) Test_PackagePath_CleanPath(c *check.C) {
           t := s.Init(c)
   
           test := func(p PackagePath, cleaned PackagePath) {
                   t.CheckEquals(p.CleanPath(), cleaned)
           }
   
           test("a/b/../../c/d/../.././e/../f", "a/b/../../e/../f")
   }
   
 func (s *Suite) Test_PackagePath_IsEmpty(c *check.C) {  func (s *Suite) Test_PackagePath_IsEmpty(c *check.C) {
         t := s.Init(c)          t := s.Init(c)
   
Line 1245  func (s *Suite) Test_PackagePath_IsEmpty
Line 1255  func (s *Suite) Test_PackagePath_IsEmpty
         test(".", false)          test(".", false)
 }  }
   
   func (s *Suite) Test_PackagePath_HasPrefixPath(c *check.C) {
           t := s.Init(c)
   
           test := func(p PackagePath, sub Path, hasPrefix bool) {
                   t.CheckEquals(p.HasPrefixPath(sub), hasPrefix)
           }
   
           test("/root/subdir", "subdir", false)
           test("/root/subdir", "/root", true)
           test("/root/subdir", "/r", false)
   }
   
   func (s *Suite) Test_PackagePath_ContainsPath(c *check.C) {
           t := s.Init(c)
   
           test := func(p PackagePath, sub Path, hasPrefix bool) {
                   t.CheckEquals(p.ContainsPath(sub), hasPrefix)
           }
   
           test("/root/subdir", "subdir", true)
           test("/root/subdir", "/root", true)
           test("/root/subdir", "/r", false)
   }
   
   func (s *Suite) Test_PackagePath_ContainsText(c *check.C) {
           t := s.Init(c)
   
           test := func(p PackagePath, sub string, hasPrefix bool) {
                   t.CheckEquals(p.ContainsText(sub), hasPrefix)
           }
   
           test("/root/subdir", "subdir", true)
           test("/root/subdir", "/root", true)
           test("/root/subdir", "/r", true)
           test("/root/subdir", "t//sub", false)
   }
   
   func (s *Suite) Test_PackagePath_Replace(c *check.C) {
           t := s.Init(c)
   
           test := func(p PackagePath, from, to string, result PackagePath) {
                   t.CheckEquals(p.Replace(from, to), result)
           }
   
           test("dir/file", "dir", "other", "other/file")
           test("dir/file", "r", "sk", "disk/file")
           test("aaa/file", "a", "sub/", "sub/sub/sub//file")
   }
   
 func (s *Suite) Test_NewRelPath(c *check.C) {  func (s *Suite) Test_NewRelPath(c *check.C) {
         t := s.Init(c)          t := s.Init(c)
   

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

CVSweb <webmaster@jp.NetBSD.org>