Fix #62: Allow clear sig variant without new line in tests

This commit is contained in:
Jakub Zelenka 2025-09-11 12:34:51 +02:00
parent ced3b06792
commit 6eda368b55
No known key found for this signature in database
GPG key ID: 1C0779DC5C0A9DE4
2 changed files with 8 additions and 8 deletions

View file

@ -1,4 +1,4 @@
--TEST--n --TEST--
sign a text with sigmode SIG_MODE_CLEAR sign a text with sigmode SIG_MODE_CLEAR
--SKIPIF-- --SKIPIF--
<?php if(!class_exists("gnupg")) die("skip"); ?> <?php if(!class_exists("gnupg")) die("skip"); ?>
@ -20,7 +20,8 @@ $tmp = false;
$ret = $gpg->verify($ret, false, $tmp); $ret = $gpg->verify($ret, false, $tmp);
var_dump($ret); var_dump($ret);
var_dump($tmp); // Some distros like Arch Linux applied patch to gnupg 2.4.8 removing the new line - see GH-62
var_dump($tmp == "foo bar\n" || $tmp == "foo bar");
?> ?>
--EXPECTF-- --EXPECTF--
array(1) { array(1) {
@ -38,8 +39,7 @@ array(1) {
int(0) int(0)
} }
} }
string(8) "foo bar bool(true)
"
--CLEAN-- --CLEAN--
<?php <?php
require_once "gnupgt.inc"; require_once "gnupgt.inc";

View file

@ -1,4 +1,4 @@
--TEST--n --TEST--
sign a text with sigmode SIG_MODE_CLEAR sign a text with sigmode SIG_MODE_CLEAR
--SKIPIF-- --SKIPIF--
<?php if (!extension_loaded("gnupg")) die("skip"); ?> <?php if (!extension_loaded("gnupg")) die("skip"); ?>
@ -18,7 +18,8 @@ $tmp = false;
$ret = gnupg_verify($gpg, $ret, false, $tmp); $ret = gnupg_verify($gpg, $ret, false, $tmp);
var_dump($ret); var_dump($ret);
var_dump($tmp); // Some distros like Arch Linux applied patch to gnupg 2.4.8 removing the new line - see GH-62
var_dump($tmp == "foo bar\n" || $tmp == "foo bar");
?> ?>
--EXPECTF-- --EXPECTF--
array(1) { array(1) {
@ -36,8 +37,7 @@ array(1) {
int(0) int(0)
} }
} }
string(8) "foo bar bool(true)
"
--CLEAN-- --CLEAN--
<?php <?php
require_once "gnupgt.inc"; require_once "gnupgt.inc";