Package: golang-github-nicksnyder-go-i18n.v2
Version: 2.1.1-2

When moving to golang 1.16, this package will be broken. The tests check
for a specific error message that has changed in 1.16. The following patch
should fix this error without breaking the test on older version of go:

diff -Nru golang-github-nicksnyder-go-i18n.v2-2.1.1/debian/patches/series
golang-github-nicksnyder-go-i18n.v2-2.1.1/debian/patches/series
--- golang-github-nicksnyder-go-i18n.v2-2.1.1/debian/patches/series
1970-01-01 00:00:00.000000000 +0000
+++ golang-github-nicksnyder-go-i18n.v2-2.1.1/debian/patches/series
2021-06-23 14:04:22.000000000 +0000
@@ -0,0 +1 @@
+update-expected-error-msg.patch
diff -Nru
golang-github-nicksnyder-go-i18n.v2-2.1.1/debian/patches/update-expected-error-msg.patch
golang-github-nicksnyder-go-i18n.v2-2.1.1/debian/patches/update-expected-error-msg.patch
---
golang-github-nicksnyder-go-i18n.v2-2.1.1/debian/patches/update-expected-error-msg.patch
   1970-01-01 00:00:00.000000000 +0000
+++
golang-github-nicksnyder-go-i18n.v2-2.1.1/debian/patches/update-expected-error-msg.patch
   2021-06-23 14:50:37.000000000 +0000
@@ -0,0 +1,43 @@
+Description: Update expected error message in test
+ As of golang 1.16, the error message from an unclosed bracket in the
text/template
+ go package has changed slightly. One of the tests in this package checks
that
+ error message, so the test must be updated to expect the new message.
+Author: William 'jawn-smith' Wilson <william.wil...@canonical.com>
+Origin: Ubuntu
+Bug-Ubuntu:
https://bugs.launchpad.net/ubuntu/+source/golang-github-nicksnyder-go-i18n.v2/+bug/1930776
+Forwarded: https://github.com/nicksnyder/go-i18n/pull/260
+Last-Update: 2021-06-23
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index:
golang-github-nicksnyder-go-i18n.v2-2.1.1/v2/internal/template_test.go
+===================================================================
+---
golang-github-nicksnyder-go-i18n.v2-2.1.1.orig/v2/internal/template_test.go
++++ golang-github-nicksnyder-go-i18n.v2-2.1.1/v2/internal/template_test.go
+@@ -1,6 +1,7 @@
+ package internal
+
+ import (
++      "strings"
+       "testing"
+       "text/template"
+ )
+@@ -45,7 +46,7 @@ func TestExecute(t *testing.T) {
+                       template: &Template{
+                               Src: "hello {{",
+                       },
+-                      err:      "template: :1: unexpected unclosed action
in command",
++                      err:      "unclosed action",
+                       noallocs: true,
+               },
+       }
+@@ -53,8 +54,8 @@ func TestExecute(t *testing.T) {
+       for _, test := range tests {
+               t.Run(test.template.Src, func(t *testing.T) {
+                       result, err := test.template.Execute(test.funcs,
test.data)
+-                      if actual := str(err); actual != test.err {
+-                              t.Errorf("expected err %q; got %q",
test.err, actual)
++                      if actual := str(err); !strings.Contains(str(err),
test.err) {
++                              t.Errorf("expected err %q to contain %q",
actual, test.err)
+                       }
+                       if result != test.result {
+                               t.Errorf("expected result %q; got %q",
test.result, result)

Reply via email to