Fix commas and emojis getting included in hashtags
Changelog-Fixed: Fix commands and emojis getting included in hashtags
This commit is contained in:
@@ -145,6 +145,26 @@ class damusTests: XCTestCase {
|
||||
XCTAssertEqual(parsed[2].is_text, " derp")
|
||||
}
|
||||
|
||||
func testHashtagWithComma() {
|
||||
let parsed = parse_mentions(content: "some hashtag #bitcoin, cool", tags: [])
|
||||
|
||||
XCTAssertNotNil(parsed)
|
||||
XCTAssertEqual(parsed.count, 3)
|
||||
XCTAssertEqual(parsed[0].is_text, "some hashtag ")
|
||||
XCTAssertEqual(parsed[1].is_hashtag, "bitcoin")
|
||||
XCTAssertEqual(parsed[2].is_text, ", cool")
|
||||
}
|
||||
|
||||
func testHashtagWithEmoji() {
|
||||
let parsed = parse_mentions(content: "some hashtag #bitcoin☕️ cool", tags: [])
|
||||
|
||||
XCTAssertNotNil(parsed)
|
||||
XCTAssertEqual(parsed.count, 3)
|
||||
XCTAssertEqual(parsed[0].is_text, "some hashtag ")
|
||||
XCTAssertEqual(parsed[1].is_hashtag, "bitcoin")
|
||||
XCTAssertEqual(parsed[2].is_text, "☕️ cool")
|
||||
}
|
||||
|
||||
func testParseHashtagEnd() {
|
||||
let parsed = parse_mentions(content: "some hashtag #bitcoin", tags: [])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user