From 70136ace46444bcef4bf2e08a26b0c869108d9ab Mon Sep 17 00:00:00 2001 From: Lukas Burkhalter Date: Wed, 30 Sep 2026 09:26:15 +0200 Subject: [PATCH] test: Fix compression tests for go 1.27 --- crypto/message_test.go | 3 ++- crypto/sessionkey_test.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crypto/message_test.go b/crypto/message_test.go index d751e701..bd304cf0 100644 --- a/crypto/message_test.go +++ b/crypto/message_test.go @@ -6,6 +6,7 @@ import ( "errors" "io" "os" + "strings" "testing" "time" @@ -151,7 +152,7 @@ func TestTextMessageEncryptionWithNonCanonicalLinebreak(t *testing.T) { func TestTextMessageEncryptionWithCompression(t *testing.T) { var message = NewPlainMessageFromString( - "The secret code is... 1, 2, 3, 4, 5. I repeat: the secret code is... 1, 2, 3, 4, 5", + strings.Repeat("The secret code is... 1, 2, 3, 4, 5. ", 20), ) ciphertext, err := keyRingTestPublic.EncryptWithCompression(message, nil) diff --git a/crypto/sessionkey_test.go b/crypto/sessionkey_test.go index afd9ebd5..b94dab83 100644 --- a/crypto/sessionkey_test.go +++ b/crypto/sessionkey_test.go @@ -5,6 +5,7 @@ import ( "encoding/hex" "errors" "os" + "strings" "testing" "github.com/ProtonMail/gopenpgp/v2/constants" @@ -320,7 +321,7 @@ func TestSessionKeyClear(t *testing.T) { func TestDataPacketEncryptionWithCompression(t *testing.T) { var message = NewPlainMessageFromString( - "The secret code is... 1, 2, 3, 4, 5. I repeat: the secret code is... 1, 2, 3, 4, 5", + strings.Repeat("The secret code is... 1, 2, 3, 4, 5. ", 20), ) // Encrypt data with session key