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

Annotation of pkgsrc/pkgtools/pkglint/files/licenses_test.go, Revision 1.3

1.1       rillig      1: package main
                      2:
                      3: import (
                      4:        check "gopkg.in/check.v1"
                      5: )
                      6:
                      7: func (s *Suite) TestParseLicenses(c *check.C) {
                      8:        c.Check(parseLicenses("gnu-gpl-v2"), check.DeepEquals, []string{"gnu-gpl-v2"})
                      9:        c.Check(parseLicenses("AND artistic"), check.DeepEquals, []string{"artistic"})
                     10: }
1.2       rillig     11:
                     12: func (s *Suite) TestChecklineLicense(c *check.C) {
                     13:        s.CreateTmpFile(c, "licenses/gnu-gpl-v2", "Most software \u2026")
                     14:        mkline := NewMkLine(NewLine("Makefile", 7, "LICENSE=dummy", nil))
                     15:        G.globalData.Pkgsrcdir = s.tmpdir
                     16:        G.CurrentDir = s.tmpdir
                     17:
                     18:        checklineLicense(mkline, "gpl-v2")
                     19:
1.3     ! rillig     20:        c.Check(s.Output(), equals, "WARN: Makefile:7: License file ~/licenses/gpl-v2 does not exist.\n")
1.2       rillig     21:
                     22:        checklineLicense(mkline, "no-profit shareware")
                     23:
1.3     ! rillig     24:        c.Check(s.Output(), equals, ""+
1.2       rillig     25:                "WARN: Makefile:7: License file ~/licenses/no-profit does not exist.\n"+
                     26:                "WARN: Makefile:7: License \"no-profit\" is deprecated.\n"+
                     27:                "WARN: Makefile:7: License file ~/licenses/shareware does not exist.\n"+
                     28:                "WARN: Makefile:7: License \"shareware\" is deprecated.\n")
                     29:
                     30:        checklineLicense(mkline, "gnu-gpl-v2")
                     31:
                     32:        c.Check(s.Output(), equals, "")
                     33: }

CVSweb <webmaster@jp.NetBSD.org>