damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit df5d6557f2c503bb939742fe3fd9d5c01b353cc9
parent 3cb628eb364b374250f2c50381d9ccda2dbf0d54
Author: William Casarin <jb55@jb55.com>
Date:   Sun,  7 Aug 2022 19:31:02 -0700

add link test

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
MdamusTests/ReplyTests.swift | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/damusTests/ReplyTests.swift b/damusTests/ReplyTests.swift @@ -43,6 +43,16 @@ class ReplyTests: XCTestCase { XCTAssertEqual(blocks[0].is_text != nil, true) } + func testLinkIsNotAHashtag() { + let link = "https://github.com/damus-io/damus/blob/b7513f28fa1d31c2747865067256ad1d7cf43aac/damus/Nostr/NostrEvent.swift#L560" + + let content = "my \(link) link" + let blocks = parse_post_blocks(content: content) + + XCTAssertEqual(blocks.count, 1) + XCTAssertEqual(blocks[0].is_text, content) + } + func testHashtagsInQuote() { let content = "This is my \"#awesome post\"" let blocks = parse_post_blocks(content: content)