-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from ensan-hcl/add_remove_api
Add remove api
- Loading branch information
Showing
2 changed files
with
42 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,30 @@ | ||
import XCTest | ||
@testable import KaomojiParser | ||
import XCTest | ||
@testable import KaomojiParser | ||
|
||
final class KaomojiParserTests: XCTestCase { | ||
func testHalfKatakana() { | ||
let parser = KaomojiParser() | ||
XCTAssertEqual(parser.isHalfKatakana("ハ"), true) | ||
XCTAssertEqual(parser.isHalfKatakana("レ"), false) | ||
XCTAssertEqual(parser.isHalfKatakana("a"), false) | ||
} | ||
final class KaomojiParserTests: XCTestCase { | ||
func testHalfKatakana() { | ||
let parser = KaomojiParser() | ||
XCTAssertEqual(parser.isHalfKatakana("ハ"), true) | ||
XCTAssertEqual(parser.isHalfKatakana("レ"), false) | ||
XCTAssertEqual(parser.isHalfKatakana("a"), false) | ||
} | ||
|
||
func testSearch() { | ||
let parser = KaomojiParser() | ||
XCTAssertEqual(parser.search(in: "嬉しいです(≧▽≦)"), ["(≧▽≦)"]) | ||
XCTAssertEqual(parser.search(in: "地震だ!┗(^o^;)┓"), ["┗(^o^;)┓"]) | ||
XCTAssertEqual(parser.search(in: "またね(・Д・)ノ"), ["(・Д・)ノ"]) | ||
XCTAssertEqual(parser.search(in: "ホームランキタ━━━━(゚∀゚)━━━━‼︎"), ["キタ━━━━(゚∀゚)━━━━‼︎"]) | ||
XCTAssertEqual(parser.search(in: "嫌い(`ε´) 絶交しよ(  ̄っ ̄)"), ["(`ε´) ", "(  ̄っ ̄)"]) | ||
} | ||
|
||
func testParser() { | ||
let parser = KaomojiParser() | ||
XCTAssertEqual(parser.search(in: "嬉しいです(≧▽≦)"), ["(≧▽≦)"]) | ||
XCTAssertEqual(parser.search(in: "地震だ!┗(^o^;)┓"), ["┗(^o^;)┓"]) | ||
XCTAssertEqual(parser.search(in: "またね(・Д・)ノ"), ["(・Д・)ノ"]) | ||
XCTAssertEqual(parser.search(in: "ホームランキタ━━━━(゚∀゚)━━━━‼︎"), ["キタ━━━━(゚∀゚)━━━━‼︎"]) | ||
XCTAssertEqual(parser.search(in: "嫌い(`ε´) 絶交しよ(  ̄っ ̄)"), ["(`ε´) ", "(  ̄っ ̄)"]) | ||
} | ||
func testRemove() { | ||
let parser = KaomojiParser() | ||
XCTAssertEqual(parser.removeKaomoji(from: "嬉しいです(≧▽≦)"), "嬉しいです") | ||
XCTAssertEqual(parser.removeKaomoji(from: "地震だ!┗(^o^;)┓"), "地震だ!") | ||
XCTAssertEqual(parser.removeKaomoji(from: "またね(・Д・)ノ"), "またね") | ||
XCTAssertEqual(parser.removeKaomoji(from: "ホームランキタ━━━━(゚∀゚)━━━━‼︎"), "ホームラン") | ||
XCTAssertEqual(parser.removeKaomoji(from: "嫌い(`ε´) 絶交しよ(  ̄っ ̄)"), "嫌い絶交しよ") | ||
} | ||
|
||
} |