pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/pkgtools/pkglint/files



Module Name:    pkgsrc
Committed By:   rillig
Date:           Tue Aug 21 19:21:41 UTC 2018

Added Files:
        pkgsrc/pkgtools/pkglint/files: line_test.go
Removed Files:
        pkgsrc/pkgtools/pkglint/files: tree.go tree_test.go

Log Message:
pkgtools/pkglint: update source files to latest state


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.13 pkgsrc/pkgtools/pkglint/files/line_test.go
cvs rdiff -u -r1.3 -r0 pkgsrc/pkgtools/pkglint/files/tree.go
cvs rdiff -u -r1.4 -r0 pkgsrc/pkgtools/pkglint/files/tree_test.go

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

Added files:

Index: pkgsrc/pkgtools/pkglint/files/line_test.go
diff -u /dev/null pkgsrc/pkgtools/pkglint/files/line_test.go:1.13
--- /dev/null   Tue Aug 21 19:21:41 2018
+++ pkgsrc/pkgtools/pkglint/files/line_test.go  Tue Aug 21 19:21:41 2018
@@ -0,0 +1,46 @@
+package main
+
+import (
+       "gopkg.in/check.v1"
+)
+
+func (s *Suite) Test_Line_log__gcc_format(c *check.C) {
+       t := s.Init(c)
+
+       t.SetupCommandLine("--gcc-output-format")
+       line := t.NewLine("filename", 123, "text")
+
+       line.Notef("Diagnostics can be logged in GCC-style.")
+
+       t.CheckOutputLines(
+               "filename:123: note: Diagnostics can be logged in GCC-style.")
+}
+
+func (s *Suite) Test_Line_log__print_source(c *check.C) {
+       t := s.Init(c)
+
+       t.SetupCommandLine("--show-autofix", "--source")
+       line := t.NewLine("filename", 123, "text")
+
+       fix := line.Autofix()
+       fix.Notef("Diagnostics can show the differences in autofix mode.")
+       fix.InsertBefore("new line before")
+       fix.InsertAfter("new line after")
+       fix.Apply()
+
+       t.CheckOutputLines(
+               "NOTE: filename:123: Diagnostics can show the differences in autofix mode.",
+               "AUTOFIX: filename:123: Inserting a line \"new line before\" before this line.",
+               "AUTOFIX: filename:123: Inserting a line \"new line after\" after this line.",
+               "+\tnew line before",
+               ">\ttext",
+               "+\tnew line after")
+}
+
+func (s *Suite) Test_RawLine_String(c *check.C) {
+       t := s.Init(c)
+
+       line := t.NewLine("filename", 123, "text")
+
+       c.Check(line.raw[0].String(), equals, "123:text\n")
+}



Home | Main Index | Thread Index | Old Index