Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
[NEW] Reaction and emoji #2795
[NEW] Reaction and emoji #2795
Conversation
|
|
||
| let string3 = "+upside_down:" | ||
| XCTAssertNil(string3.reaction()) | ||
|
|
houndci-bot
Nov 27, 2019
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
|
|
||
| let string2 = ":upside_down:" | ||
| XCTAssertNil(string2.reaction()) | ||
|
|
houndci-bot
Nov 27, 2019
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
| } | ||
|
|
||
| XCTAssertEqual(emoji, ":upside_down:") | ||
|
|
houndci-bot
Nov 27, 2019
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
| guard let emoji = string.reaction() else { | ||
| return XCTFail("string is valid reaction") | ||
| } | ||
|
|
houndci-bot
Nov 27, 2019
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
|
|
||
| func testReaction() { | ||
| let string = "+:upside_down:" | ||
|
|
houndci-bot
Nov 27, 2019
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
| @@ -146,4 +146,23 @@ class StringExtensionSpec: XCTestCase { | |||
|
|
|||
| XCTAssertNil(string2.commandAndParams()) | |||
| } | |||
|
|
|||
houndci-bot
Nov 27, 2019
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
|
|
||
| let emoji = String(self.dropFirst()) | ||
| guard emoji.first == ":" && emoji.last == ":" else { return nil } | ||
|
|
houndci-bot
Nov 27, 2019
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
|
|
||
| func reaction() -> String? { | ||
| guard self.first == "+" && self.count > 1 else { return nil } | ||
|
|
houndci-bot
Nov 27, 2019
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
| @@ -137,6 +137,15 @@ extension String { | |||
| let params = components.dropFirst().joined(separator: " ") | |||
| return (command: command, params: params) | |||
| } | |||
|
|
|||
houndci-bot
Nov 27, 2019
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
@RocketChat/ios
Closes #2638
Closes #2627