summaryrefslogtreecommitdiff
path: root/pkgtools/pkglint/files/dir_test.go
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2017-01-01 15:15:47 +0000
committerrillig <rillig@pkgsrc.org>2017-01-01 15:15:47 +0000
commit28c19c5030a18d04154521d8e885d9ed9e4dfe7b (patch)
tree5ec89189d5ed37c372aa58833c424cbf118ee563 /pkgtools/pkglint/files/dir_test.go
parentc64a10190815393b53dffb31220999444331838f (diff)
downloadpkgsrc-28c19c5030a18d04154521d8e885d9ed9e4dfe7b.tar.gz
Cleaned up and refactored code.
The getopt and pkgver code have been extracted to separate packages to make them reusable. Several other functions have been moved to make the structure easier to understand: * dir.go and main.go have been moved to pkglint.go * utility functions from pkglint.go have been moved to mkline.go Now pkglint.go contains only high-level code.
Diffstat (limited to 'pkgtools/pkglint/files/dir_test.go')
-rw-r--r--pkgtools/pkglint/files/dir_test.go39
1 files changed, 0 insertions, 39 deletions
diff --git a/pkgtools/pkglint/files/dir_test.go b/pkgtools/pkglint/files/dir_test.go
deleted file mode 100644
index aa99c046f01..00000000000
--- a/pkgtools/pkglint/files/dir_test.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package main
-
-import (
- check "gopkg.in/check.v1"
-)
-
-func (s *Suite) Test_CheckDirent_outside(c *check.C) {
- s.Init(c)
- s.CreateTmpFile("empty", "")
-
- CheckDirent(s.tmpdir)
-
- c.Check(s.Output(), equals, "ERROR: ~: Cannot determine the pkgsrc root directory for \"~\".\n")
-}
-
-func (s *Suite) Test_CheckDirent(c *check.C) {
- s.Init(c)
- s.CreateTmpFile("mk/bsd.pkg.mk", "")
- s.CreateTmpFile("category/package/Makefile", "")
- s.CreateTmpFile("category/Makefile", "")
- s.CreateTmpFile("Makefile", "")
- G.globalData.Pkgsrcdir = s.tmpdir
-
- CheckDirent(s.tmpdir)
-
- c.Check(s.Output(), equals, "ERROR: ~/Makefile: Must not be empty.\n")
-
- CheckDirent(s.tmpdir + "/category")
-
- c.Check(s.Output(), equals, "ERROR: ~/category/Makefile: Must not be empty.\n")
-
- CheckDirent(s.tmpdir + "/category/package")
-
- c.Check(s.Output(), equals, "ERROR: ~/category/package/Makefile: Must not be empty.\n")
-
- CheckDirent(s.tmpdir + "/category/package/nonexistent")
-
- c.Check(s.Output(), equals, "ERROR: ~/category/package/nonexistent: No such file or directory.\n")
-}