[NEW] Reaction and emoji #2795
base: develop
Are you sure you want to change the base?
[NEW] Reaction and emoji #2795
Conversation
|
||
let string3 = "+upside_down:" | ||
XCTAssertNil(string3.reaction()) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
|
||
let string2 = ":upside_down:" | ||
XCTAssertNil(string2.reaction()) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
} | ||
|
||
XCTAssertEqual(emoji, ":upside_down:") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
guard let emoji = string.reaction() else { | ||
return XCTFail("string is valid reaction") | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
|
||
func testReaction() { | ||
let string = "+:upside_down:" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
@@ -146,4 +146,23 @@ class StringExtensionSpec: XCTestCase { | |||
|
|||
XCTAssertNil(string2.commandAndParams()) | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
|
||
let emoji = String(self.dropFirst()) | ||
guard emoji.first == ":" && emoji.last == ":" else { return nil } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
|
||
func reaction() -> String? { | ||
guard self.first == "+" && self.count > 1 else { return nil } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
7ea400e
to
131afc4
Compare
@RocketChat/ios
Closes #2638
Closes #2627