New Upstream Release - golang-check.v1

Ready changes

Summary

Merged new upstream version: 0.0+git20201130.10cb982 (was: 0.0+git20200902.038fdea).

Resulting package

Built on 2023-01-16T16:43 (took 9m9s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-releases golang-gopkg-check.v1-dev

Lintian Result

Diff

diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
new file mode 100644
index 0000000..6d8911a
--- /dev/null
+++ b/.github/workflows/test.yaml
@@ -0,0 +1,44 @@
+name: test
+
+on:
+  push:
+  pull_request:
+
+jobs:
+  test:
+    strategy:
+      matrix:
+        os:
+          - ubuntu-latest
+          - macos-latest
+          - windows-latest
+
+    runs-on: ${{ matrix.os }}
+    steps:
+      - uses: actions/setup-go@v2
+        with:
+          go-version: '^1.13.0' # Latest 1.x release >= 1.13
+      - uses: actions/checkout@v2
+      - name: Build
+        run: go build .
+      - name: Test
+        run: go test -v ./...
+
+  gopath:
+    runs-on: ubuntu-latest
+    env:
+      GOPATH: ${{ github.workspace }}
+      package: gopkg.in/check.v1
+    steps:
+      - uses: actions/setup-go@v2
+        with:
+          go-version: '1.9.x'
+      - uses: actions/checkout@v2
+        with:
+          path: src/${{ env.package }}
+      - name: Dependencies
+        run: go get -t -d -v ${{ env.package }}/...
+      - name: Build
+        run: go build ${{ env.package }}
+      - name: Test
+        run: go test -v ${{ env.package }}/...
diff --git a/benchmark_test.go b/benchmark_test.go
index 8b6a8a6..122291e 100644
--- a/benchmark_test.go
+++ b/benchmark_test.go
@@ -70,7 +70,7 @@ func (s *BenchmarkS) TestBenchmarkBytes(c *C) {
 	}
 	Run(&helper, &runConf)
 
-	expected := "PASS: check_test\\.go:[0-9]+: FixtureHelper\\.Benchmark2\t\\s+[0-9]+\t\\s+[0-9]+ ns/op\t\\s+ *[1-9]\\.[0-9]{2} MB/s\n"
+	expected := "PASS: check_test\\.go:[0-9]+: FixtureHelper\\.Benchmark2\t\\s+[0-9]+\t\\s+[0-9]+ ns/op\t\\s+ *[0-9]\\.[0-9]{2} MB/s\n"
 	c.Assert(output.value, Matches, expected)
 }
 
diff --git a/check.go b/check.go
index de714c2..bba8d8b 100644
--- a/check.go
+++ b/check.go
@@ -11,7 +11,7 @@ import (
 	"errors"
 	"fmt"
 	"io"
-	"math/rand"
+	"io/ioutil"
 	"os"
 	"path"
 	"path/filepath"
@@ -143,17 +143,11 @@ func (td *tempDir) newPath() string {
 	td.Lock()
 	defer td.Unlock()
 	if td.path == "" {
-		var err error
-		for i := 0; i != 100; i++ {
-			path := fmt.Sprintf("%s%ccheck-%d", os.TempDir(), os.PathSeparator, rand.Int())
-			if err = os.Mkdir(path, 0700); err == nil {
-				td.path = path
-				break
-			}
-		}
-		if td.path == "" {
+		path, err := ioutil.TempDir("", "check-")
+		if err != nil {
 			panic("Couldn't create temporary directory: " + err.Error())
 		}
+		td.path = path
 	}
 	result := filepath.Join(td.path, strconv.Itoa(td.counter))
 	td.counter++
diff --git a/checkers.go b/checkers.go
index e146429..0326197 100644
--- a/checkers.go
+++ b/checkers.go
@@ -6,7 +6,7 @@ import (
 	"regexp"
 	"strings"
 
-	"github.com/niemeyer/pretty"
+	"github.com/kr/pretty"
 )
 
 // -----------------------------------------------------------------------
diff --git a/debian/changelog b/debian/changelog
index 8a90347..0d0a3a9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+golang-check.v1 (0.0+git20201130.10cb982-1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+  * Drop patch 02-unfork-kr-pretty.patch, present upstream.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Mon, 16 Jan 2023 16:35:53 -0000
+
 golang-check.v1 (0.0+git20200902.038fdea-1) unstable; urgency=medium
 
   * New upstream version 0.0+git20200902.038fdea
diff --git a/debian/patches/01-Skip_flaky_tests.patch b/debian/patches/01-Skip_flaky_tests.patch
index b1a9fdd..ab83801 100644
--- a/debian/patches/01-Skip_flaky_tests.patch
+++ b/debian/patches/01-Skip_flaky_tests.patch
@@ -1,7 +1,9 @@
 Description: Skip_flaky_tests
---- a/benchmark_test.go
-+++ b/benchmark_test.go
-@@ -16,6 +16,7 @@
+Index: golang-check.v1.git/benchmark_test.go
+===================================================================
+--- golang-check.v1.git.orig/benchmark_test.go
++++ golang-check.v1.git/benchmark_test.go
+@@ -16,6 +16,7 @@ func (s *BenchmarkS) TestCountSuite(c *C
  }
  
  func (s *BenchmarkS) TestBasicTestTiming(c *C) {
@@ -9,7 +11,7 @@ Description: Skip_flaky_tests
  	helper := FixtureHelper{sleepOn: "Test1", sleep: 1000000 * time.Nanosecond}
  	output := String{}
  	runConf := RunConf{Output: &output, Verbose: true}
-@@ -27,6 +28,7 @@
+@@ -27,6 +28,7 @@ func (s *BenchmarkS) TestBasicTestTiming
  }
  
  func (s *BenchmarkS) TestStreamTestTiming(c *C) {
@@ -17,7 +19,7 @@ Description: Skip_flaky_tests
  	helper := FixtureHelper{sleepOn: "SetUpSuite", sleep: 1000000 * time.Nanosecond}
  	output := String{}
  	runConf := RunConf{Output: &output, Stream: true}
-@@ -37,6 +39,7 @@
+@@ -37,6 +39,7 @@ func (s *BenchmarkS) TestStreamTestTimin
  }
  
  func (s *BenchmarkS) TestBenchmark(c *C) {
@@ -25,7 +27,7 @@ Description: Skip_flaky_tests
  	helper := FixtureHelper{sleep: 100000}
  	output := String{}
  	runConf := RunConf{
-@@ -60,6 +63,7 @@
+@@ -60,6 +63,7 @@ func (s *BenchmarkS) TestBenchmark(c *C)
  }
  
  func (s *BenchmarkS) TestBenchmarkBytes(c *C) {
@@ -33,7 +35,7 @@ Description: Skip_flaky_tests
  	helper := FixtureHelper{sleep: 100000}
  	output := String{}
  	runConf := RunConf{
-@@ -75,6 +79,7 @@
+@@ -75,6 +79,7 @@ func (s *BenchmarkS) TestBenchmarkBytes(
  }
  
  func (s *BenchmarkS) TestBenchmarkMem(c *C) {
diff --git a/debian/patches/02-unfork-kr-pretty.patch b/debian/patches/02-unfork-kr-pretty.patch
deleted file mode 100644
index 01d7cd5..0000000
--- a/debian/patches/02-unfork-kr-pretty.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Description: Revert upstream "Avoid cycle bug by forking kr/pretty"
- "diff: detect cycles in the values being compared" at
- https://github.com/kr/pretty/pull/64 has been merged by @kr
- on 2020-08-10 and is part of 0.2.1+git20200831.59b4212,
- thus the github.com/niemeyer/pretty fork is no longer necessary
- and need not be packaged for Debian.
-Author: Anthony Fok <foka@debian.org>
-Origin: vendor
-Forwarded: not-needed
-Last-Update: 2020-11-09
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- a/checkers.go
-+++ b/checkers.go
-@@ -6,7 +6,7 @@
- 	"regexp"
- 	"strings"
- 
--	"github.com/niemeyer/pretty"
-+	"github.com/kr/pretty"
- )
- 
- // -----------------------------------------------------------------------
diff --git a/debian/patches/series b/debian/patches/series
index 0861dbb..47926eb 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1 @@
 01-Skip_flaky_tests.patch
-02-unfork-kr-pretty.patch
diff --git a/go.mod b/go.mod
new file mode 100644
index 0000000..350cdd6
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,5 @@
+module gopkg.in/check.v1
+
+go 1.11
+
+require github.com/kr/pretty v0.2.1
diff --git a/go.sum b/go.sum
new file mode 100644
index 0000000..10212ca
--- /dev/null
+++ b/go.sum
@@ -0,0 +1,5 @@
+github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
+github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
diff --git a/run_test.go b/run_test.go
index f41fffc..e7f68a2 100644
--- a/run_test.go
+++ b/run_test.go
@@ -6,6 +6,7 @@ import (
 	"errors"
 	. "gopkg.in/check.v1"
 	"os"
+	"regexp"
 	"sync"
 )
 
@@ -411,7 +412,7 @@ func (s *RunS) TestKeepWorkDir(c *C) {
 	runConf := RunConf{Output: &output, Verbose: true, KeepWorkDir: true}
 	result := Run(&WorkDirSuite{}, &runConf)
 
-	c.Assert(result.String(), Matches, ".*\nWORK=" + result.WorkDir)
+	c.Assert(result.String(), Matches, ".*\nWORK=" + regexp.QuoteMeta(result.WorkDir))
 
 	stat, err := os.Stat(result.WorkDir)
 	c.Assert(err, IsNil)

More details

Full run details