Skip to content

Commit c7ff73b

Browse files
authored
Refactored code (#3023)
* Refactored code.| #3022 * Refactored code.| #3022
1 parent 6cddcf9 commit c7ff73b

43 files changed

Lines changed: 1020 additions & 1995 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

FlowCrypt/src/test/java/com/flowcrypt/email/core/msg/RawBlockParserTest.kt

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
11
/*
22
* © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
3-
* Contributors: Ivan Pizhenko
3+
* Contributors: denbond7
44
*/
55

66
package com.flowcrypt.email.core.msg
77

88
import com.flowcrypt.email.extensions.kotlin.normalize
9+
import com.flowcrypt.email.security.pgp.PgpSignature
10+
import com.flowcrypt.email.util.TestUtil
911
import org.junit.Assert.assertEquals
1012
import org.junit.Test
1113

1214
class RawBlockParserTest {
15+
16+
@Test
17+
fun testExtractClearTextFromMsgSignedMessagePreserveNewlines() {
18+
val text = TestUtil.readResourceAsString("pgp/messages/signed-message-preserve-newlines.txt")
19+
val blocks = RawBlockParser.detectBlocks(text).toList()
20+
val clearText = PgpSignature.extractClearText(text)
21+
assertEquals(
22+
"Standard message\n\nsigned inline\n\nshould easily verify\nThis is email footer",
23+
clearText
24+
)
25+
assertEquals(1, blocks.size)
26+
assertEquals(RawBlockParser.RawBlockType.PGP_CLEARSIGN_MSG, blocks[0].type)
27+
}
28+
1329
@Test
1430
fun testNoStringIndexOutOfBoundsExceptionInParser() {
1531
checkForSinglePlaintextBlock("-----BEGIN FOO-----\n")

0 commit comments

Comments
 (0)