New Upstream Snapshot - golang-github-jacobsa-timeutil
Ready changes
Summary
Merged new upstream version: 0.0~git20170206 (was: 0.0~git20150615).
Resulting package
Built on 2022-11-20T08:41 (took 4m23s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-snapshots golang-github-jacobsa-timeutil-dev
Lintian Result
Diff
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..b972119
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,4 @@
+# Cf. http://docs.travis-ci.com/user/getting-started/
+# Cf. http://docs.travis-ci.com/user/languages/go/
+
+language: go
diff --git a/debian/changelog b/debian/changelog
index ed25a80..3a23ff5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-golang-github-jacobsa-timeutil (0.0~git20150615-3) UNRELEASED; urgency=medium
+golang-github-jacobsa-timeutil (0.0~git20170206-1) UNRELEASED; urgency=medium
[ Alexandre Viau ]
* Point Vcs-* urls to salsa.debian.org.
@@ -9,8 +9,9 @@ golang-github-jacobsa-timeutil (0.0~git20150615-3) UNRELEASED; urgency=medium
golang-github-jacobsa-ogletest-dev.
+ golang-github-jacobsa-timeutil-dev: Drop versioned constraint on
golang-github-jacobsa-ogletest-dev in Depends.
+ * New upstream snapshot.
- -- Alexandre Viau <aviau@debian.org> Mon, 02 Apr 2018 18:06:30 -0400
+ -- Alexandre Viau <aviau@debian.org> Sun, 20 Nov 2022 08:38:35 -0000
golang-github-jacobsa-timeutil (0.0~git20150615-2) unstable; urgency=medium
diff --git a/time_eq.go b/time_eq.go
index 01bde1d..a1fbd66 100644
--- a/time_eq.go
+++ b/time_eq.go
@@ -28,14 +28,27 @@ func timeEq(expected time.Time, c interface{}) error {
return errors.New("which is not a time")
}
+ // Make sure the times are the same instant.
if diff := actual.Sub(expected); diff != 0 {
return fmt.Errorf("which is off by %v", diff)
}
+ // Compare using == to capture other equality semantics; in particular
+ // location.
+ if actual != expected {
+ return errors.New("")
+ }
+
return nil
}
-// Return a matcher for times that are exactly equal to the given input time.
+// Return a matcher for times that are exactly equal to the given input time
+// according to the == operator, which compares on location, instant, and
+// monotonic clock reading.
+//
+// If you want to ignore location, canonicalize using Time.UTC. If you want to
+// ignore ignore monotonic clock reading, strip it using Time.AddDate(0, 0, 0)
+// (cf. https://goo.gl/rYU5UI).
func TimeEq(t time.Time) oglematchers.Matcher {
return oglematchers.NewMatcher(
func(c interface{}) error { return timeEq(t, c) },
diff --git a/time_eq_test.go b/time_eq_test.go
index cfb6ca3..0a9495b 100644
--- a/time_eq_test.go
+++ b/time_eq_test.go
@@ -18,9 +18,9 @@ import (
"testing"
"time"
- "github.com/jacobsa/timeutil"
. "github.com/jacobsa/oglematchers"
. "github.com/jacobsa/ogletest"
+ "github.com/jacobsa/timeutil"
)
func TestTimeEq(t *testing.T) { RunTests(t) }
@@ -76,6 +76,12 @@ func (t *TimeEqTest) ActualAndExpectedDontMatch() {
AssertNe(nil, err)
ExpectThat(err, Error(HasSubstr("off by 2s")))
+
+ // Wrong location
+ err = matcher.Matches(expected.UTC())
+
+ AssertNe(nil, err)
+ ExpectThat(err, Error(Equals("")))
}
func (t *TimeEqTest) ActualAndExpectedMatch() {
Debdiff
File lists identical (after any substitutions)
No differences were encountered in the control files