diff --git a/SmileTests/Tests.swift b/SmileTests/Tests.swift index 1fd6f92..c8ca238 100644 --- a/SmileTests/Tests.swift +++ b/SmileTests/Tests.swift @@ -82,12 +82,14 @@ class Tests: XCTestCase { XCTAssertEqual(Smile.extractEmojis(string: "Find the solos ⌨️ and ⭐️"), "⌨️⭐️") XCTAssertEqual(Smile.extractEmojis(string: "Find the 👨‍✈️👨‍🏫💂 and 👨‍💻"), "👨‍✈️👨‍🏫💂👨‍💻") XCTAssertEqual(Smile.extractEmojis(string: "⌚️"), "⌚️") + XCTAssertEqual(Smile.extractEmojis(string: "Hello ⏰⌛️💳 and 🆙."), "⏰⌛️💳🆙") } func testRemoveEmoji() { XCTAssertEqual(Smile.removeEmojis(string: "Find 🔑and🔎"), "Find and") XCTAssertEqual(Smile.removeEmojis(string: "Remove the 👨‍🏫"), "Remove the ") XCTAssertEqual(Smile.removeEmojis(string: "🥑🦈🏍🛴🤡🦋🥚🦐🦑👰🇬🇧🎅🤑👍🏿☔️☂️☃️☀️❗️💀☠️⚔️⚖️☁️"), "") + XCTAssertEqual(Smile.removeEmojis(string: "⏰⌛️💳🆙"), "") // Variation selectors XCTAssertEqual(Smile.removeEmojis(string: "👨‍✈️⚔️"), "") diff --git a/Sources/Smile.swift b/Sources/Smile.swift index 6886338..c0a6d81 100644 --- a/Sources/Smile.swift +++ b/Sources/Smile.swift @@ -15,6 +15,7 @@ public func list() -> [String] { let ranges = [ 0x1F601...0x1F64F, 0x2600...0x27B0, + 0x23F0...0x23FA, 0x1F680...0x1F6C0, 0x1F170...0x1F251 ] @@ -24,7 +25,7 @@ public func list() -> [String] { } //⌚️⌨️⭐️ - let solos = [0x231A, 0x2328, 0x2B50] + let solos = [0x231A, 0x231B, 0x2328, 0x2B50] all.append(contentsOf: solos.map({ String(Character(UnicodeScalar($0)!))})) return all