mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-09 18:29:39 +02:00
Fix test by comparing to CRLF'd plaintext
This commit is contained in:
parent
cb6dde4e39
commit
bfdbac0f2d
1 changed files with 6 additions and 2 deletions
|
@ -138,6 +138,10 @@ public class RoundTripInlineSignInlineVerifyCmdTest extends CLITest {
|
||||||
"\n" +
|
"\n" +
|
||||||
"There is only one Lord of the Keys, only one who can bend them to his will. And he does not share power.";
|
"There is only one Lord of the Keys, only one who can bend them to his will. And he does not share power.";
|
||||||
|
|
||||||
|
private static final String MESSAGE_CRLF = "One does not simply use OpenPGP!\r\n" +
|
||||||
|
"\r\n" +
|
||||||
|
"There is only one Lord of the Keys, only one who can bend them to his will. And he does not share power.";
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void createCleartextSignedMessage() throws IOException {
|
public void createCleartextSignedMessage() throws IOException {
|
||||||
File key = writeFile("key.asc", KEY_1);
|
File key = writeFile("key.asc", KEY_1);
|
||||||
|
@ -153,7 +157,7 @@ public class RoundTripInlineSignInlineVerifyCmdTest extends CLITest {
|
||||||
String cleartextSigned = ciphertextOut.toString();
|
String cleartextSigned = ciphertextOut.toString();
|
||||||
assertTrue(cleartextSigned.startsWith("-----BEGIN PGP SIGNED MESSAGE-----\n" +
|
assertTrue(cleartextSigned.startsWith("-----BEGIN PGP SIGNED MESSAGE-----\n" +
|
||||||
"Hash: "));
|
"Hash: "));
|
||||||
assertTrue(cleartextSigned.contains(MESSAGE));
|
assertTrue(cleartextSigned.contains(MESSAGE_CRLF));
|
||||||
assertTrue(cleartextSigned.contains("\n-----BEGIN PGP SIGNATURE-----\n"));
|
assertTrue(cleartextSigned.contains("\n-----BEGIN PGP SIGNATURE-----\n"));
|
||||||
assertTrue(cleartextSigned.endsWith("-----END PGP SIGNATURE-----\n"));
|
assertTrue(cleartextSigned.endsWith("-----END PGP SIGNATURE-----\n"));
|
||||||
}
|
}
|
||||||
|
@ -203,7 +207,7 @@ public class RoundTripInlineSignInlineVerifyCmdTest extends CLITest {
|
||||||
"--verifications-out", verifications.getAbsolutePath(),
|
"--verifications-out", verifications.getAbsolutePath(),
|
||||||
cert.getAbsolutePath()));
|
cert.getAbsolutePath()));
|
||||||
|
|
||||||
assertEquals(MESSAGE, plaintextOut.toString());
|
assertEquals(MESSAGE_CRLF, plaintextOut.toString());
|
||||||
String verificationString = readStringFromFile(verifications);
|
String verificationString = readStringFromFile(verifications);
|
||||||
assertTrue(verificationString.contains(CERT_1_SIGNING_KEY));
|
assertTrue(verificationString.contains(CERT_1_SIGNING_KEY));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue