[BACK]Return to licenses_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/Attic/licenses_test.go between version 1.3 and 1.11

version 1.3, 2016/01/27 21:55:50 version 1.11, 2018/03/24 14:32:49
Line 4  import (
Line 4  import (
         check "gopkg.in/check.v1"          check "gopkg.in/check.v1"
 )  )
   
 func (s *Suite) TestParseLicenses(c *check.C) {  func (s *Suite) Test_checklineLicense(c *check.C) {
         c.Check(parseLicenses("gnu-gpl-v2"), check.DeepEquals, []string{"gnu-gpl-v2"})          t := s.Init(c)
         c.Check(parseLicenses("AND artistic"), check.DeepEquals, []string{"artistic"})  
 }          t.SetupFileLines("licenses/gnu-gpl-v2",
                   "Most software \u2026")
           mkline := t.NewMkLine("Makefile", 7, "LICENSE=dummy")
           G.CurrentDir = t.TmpDir()
   
           licenseChecker := &LicenseChecker{mkline}
           licenseChecker.Check("gpl-v2", opAssign)
   
           t.CheckOutputLines(
                   "WARN: Makefile:7: License file ~/licenses/gpl-v2 does not exist.")
   
           licenseChecker.Check("no-profit shareware", opAssign)
   
           t.CheckOutputLines(
                   "ERROR: Makefile:7: Parse error for license condition \"no-profit shareware\".")
   
           licenseChecker.Check("no-profit AND shareware", opAssign)
   
 func (s *Suite) TestChecklineLicense(c *check.C) {          t.CheckOutputLines(
         s.CreateTmpFile(c, "licenses/gnu-gpl-v2", "Most software \u2026")                  "WARN: Makefile:7: License file ~/licenses/no-profit does not exist.",
         mkline := NewMkLine(NewLine("Makefile", 7, "LICENSE=dummy", nil))                  "ERROR: Makefile:7: License \"no-profit\" must not be used.",
         G.globalData.Pkgsrcdir = s.tmpdir                  "WARN: Makefile:7: License file ~/licenses/shareware does not exist.",
         G.CurrentDir = s.tmpdir                  "ERROR: Makefile:7: License \"shareware\" must not be used.")
   
         checklineLicense(mkline, "gpl-v2")          licenseChecker.Check("gnu-gpl-v2", opAssign)
   
         c.Check(s.Output(), equals, "WARN: Makefile:7: License file ~/licenses/gpl-v2 does not exist.\n")          t.CheckOutputEmpty()
   
         checklineLicense(mkline, "no-profit shareware")          licenseChecker.Check("gnu-gpl-v2 AND gnu-gpl-v2 OR gnu-gpl-v2", opAssign)
   
         c.Check(s.Output(), equals, ""+          t.CheckOutputLines(
                 "WARN: Makefile:7: License file ~/licenses/no-profit does not exist.\n"+                  "ERROR: Makefile:7: AND and OR operators in license conditions can only be combined using parentheses.")
                 "WARN: Makefile:7: License \"no-profit\" is deprecated.\n"+  
                 "WARN: Makefile:7: License file ~/licenses/shareware does not exist.\n"+  
                 "WARN: Makefile:7: License \"shareware\" is deprecated.\n")  
   
         checklineLicense(mkline, "gnu-gpl-v2")          licenseChecker.Check("(gnu-gpl-v2 OR gnu-gpl-v2) AND gnu-gpl-v2", opAssign)
   
         c.Check(s.Output(), equals, "")          t.CheckOutputEmpty()
 }  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.11

CVSweb <webmaster@jp.NetBSD.org>