summaryrefslogtreecommitdiff
path: root/pkgtools/pkglint/files/toplevel_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkgtools/pkglint/files/toplevel_test.go')
-rw-r--r--pkgtools/pkglint/files/toplevel_test.go39
1 files changed, 19 insertions, 20 deletions
diff --git a/pkgtools/pkglint/files/toplevel_test.go b/pkgtools/pkglint/files/toplevel_test.go
index 6055c7b1415..a37c09e81a5 100644
--- a/pkgtools/pkglint/files/toplevel_test.go
+++ b/pkgtools/pkglint/files/toplevel_test.go
@@ -1,31 +1,30 @@
package main
-import (
- check "gopkg.in/check.v1"
-)
+import "gopkg.in/check.v1"
func (s *Suite) Test_CheckdirToplevel(c *check.C) {
- s.Init(c)
- s.CreateTmpFile("Makefile", ""+
- "# $"+"NetBSD$\n"+
- "\n"+
- "SUBDIR+= x11\n"+
- "SUBDIR+=\tarchivers\n"+
- "SUBDIR+=\tccc\n"+
- "SUBDIR+=\tccc\n"+
- "#SUBDIR+=\tignoreme\n"+
- "SUBDIR+=\tnonexisting\n"+ // This doesn't happen in practice, therefore no warning.
- "SUBDIR+=\tbbb\n")
- s.CreateTmpFile("archivers/Makefile", "")
- s.CreateTmpFile("bbb/Makefile", "")
- s.CreateTmpFile("ccc/Makefile", "")
- s.CreateTmpFile("x11/Makefile", "")
+ t := s.Init(c)
+
+ t.SetupFileLines("Makefile",
+ MkRcsId,
+ "",
+ "SUBDIR+= x11",
+ "SUBDIR+=\tarchivers",
+ "SUBDIR+=\tccc",
+ "SUBDIR+=\tccc",
+ "#SUBDIR+=\tignoreme",
+ "SUBDIR+=\tnonexisting", // This doesn't happen in practice, therefore no warning.
+ "SUBDIR+=\tbbb")
+ t.SetupFileLines("archivers/Makefile")
+ t.SetupFileLines("bbb/Makefile")
+ t.SetupFileLines("ccc/Makefile")
+ t.SetupFileLines("x11/Makefile")
G.globalData.InitVartypes()
- G.CurrentDir = s.tmpdir
+ G.CurrentDir = t.TmpDir()
CheckdirToplevel()
- s.CheckOutputLines(
+ t.CheckOutputLines(
"WARN: ~/Makefile:3: Indentation should be a single tab character.",
"ERROR: ~/Makefile:6: Each subdir must only appear once.",
"WARN: ~/Makefile:7: \"ignoreme\" commented out without giving a reason.",