forked from kc3hack/2024_H
-
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.
Browse files
Browse the repository at this point in the history
ScrapingHelper.SplitBraceの条件式の修正とテストの作成
- Loading branch information
Showing
3 changed files
with
48 additions
and
18 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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using KoeBook.Epub.Utility; | ||
|
||
namespace KoeBook.Test.Epub; | ||
|
||
public class ScrapingHelperTest | ||
{ | ||
public static object[][] TestCases() | ||
{ | ||
(string, List<string>)[] cases = [ | ||
("「", ["「"]), | ||
("」", ["」"]), | ||
("a", ["a"]), | ||
("abc「abc」abc", ["abc", "「abc」", "abc"]), | ||
("abc「abc」", ["abc", "「abc」"]), | ||
("「abc」abc", ["「abc」", "abc",]), | ||
("abc「abc」", ["abc", "「abc」"]), | ||
("「abc」", ["「abc」",]), | ||
("abc「abc", ["abc", "「abc"]), | ||
("abc「", ["abc", "「"]), | ||
("「abc", ["「abc"]), | ||
("abc」abc", ["abc」", "abc"]), | ||
("abc」", ["abc」"]), | ||
("」abc", ["」", "abc"]), | ||
("abc「abc」abc「abc」abc", ["abc", "「abc」", "abc", "「abc」", "abc"]), | ||
("「abc」abc「abc」abc", ["「abc」", "abc", "「abc」", "abc"]), | ||
("abc「abc」「abc」abc", ["abc", "「abc」", "「abc」", "abc"]), | ||
("abc「abc」abc「abc」", ["abc", "「abc」", "abc", "「abc」"]), | ||
("abc「abc「abc」abc」abc", ["abc", "「abc「abc」abc」", "abc"]), | ||
("abc「abc「abc」abc", ["abc", "「abc「abc」abc"]), | ||
("abc「abc」abc」abc", ["abc「abc」abc」", "abc"]), | ||
("abc「abc「abc", ["abc", "「abc「abc"]), | ||
("abc」abc」abc", ["abc」abc」", "abc"]) | ||
]; | ||
return cases.Select(c => new object[] { c.Item1, c.Item2 }).ToArray(); | ||
} | ||
|
||
[Theory] | ||
[MemberData(nameof(TestCases))] | ||
public void SplitBraceTest(string text, List<string> expected) | ||
{ | ||
Assert.Equal(expected, ScrapingHelper.SplitBrace(text)); | ||
|
||
} | ||
} |
This file was deleted.
Oops, something went wrong.