Browse Source

test invalid mention

Signed-off-by: William Casarin <jb55@jb55.com>
profiles-everywhere
William Casarin 3 years ago
parent
commit
96d8d854e2
  1. 15
      damusTests/damusTests.swift

15
damusTests/damusTests.swift

@ -43,6 +43,21 @@ class damusTests: XCTestCase {
XCTAssertTrue(parsed[2].is_text)
}
func testParseInvalidMention() throws {
let parsed = parse_mentions(content: "this is #[0] a mention", tags: [])
XCTAssertNotNil(parsed)
XCTAssertEqual(parsed.count, 1)
XCTAssertTrue(parsed[0].is_text)
guard case .text(let txt) = parsed[0] else {
XCTAssertTrue(false)
return
}
XCTAssertEqual(txt, "this is #[0] a mention")
}
func testParseMentionBlank() {
let parsed = parse_mentions(content: "", tags: [["e", "event_id"]])

Loading…
Cancel
Save