| 1 | From dd203f29a36bf518deacbc03e8562b0195c8345f Mon Sep 17 00:00:00 2001
|
| 2 | From: Dominic Martinez <[email protected]>
|
| 3 | Date: Mon, 4 Apr 2022 12:06:03 -0400
|
| 4 | Subject: [PATCH] Fix failing qr decode test
|
| 5 |
|
| 6 | First convert integers into runes before performing a string conversion.
|
| 7 | ---
|
| 8 | qrcode_decode_test.go | 4 ++--
|
| 9 | 1 file changed, 2 insertions(+), 2 deletions(-)
|
| 10 |
|
| 11 | diff --git a/qrcode_decode_test.go b/qrcode_decode_test.go
|
| 12 | index 1f4b1d3..2b0756b 100644
|
| 13 | |
| 14 | |
| 15 | @@ -122,7 +122,7 @@ func TestDecodeAllCharacters(t *testing.T) {
|
| 16 |
|
| 17 | // zbarimg has trouble with null bytes, hence start from ASCII 1.
|
| 18 | for i := 1; i < 256; i++ {
|
| 19 | - content += string(i)
|
| 20 | + content += string(rune(i))
|
| 21 | }
|
| 22 |
|
| 23 | q, err := New(content, Low)
|
| 24 | @@ -154,7 +154,7 @@ func TestDecodeFuzz(t *testing.T) {
|
| 25 | for j := 0; j < len; j++ {
|
| 26 | // zbarimg seems to have trouble with special characters, test printable
|
| 27 | // characters only for now.
|
| 28 | - content += string(32 + r.Intn(94))
|
| 29 | + content += string(rune(32 + r.Intn(94)))
|
| 30 | }
|
| 31 |
|
| 32 | for _, level := range []RecoveryLevel{Low, Medium, High, Highest} {
|
| 33 |
|
| 34 | base-commit: da1b6568686e89143e94f980a98bc2dbd5537f13
|
| 35 | --
|
| 36 | 2.34.0
|
| 37 |
|