-
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.
- Loading branch information
Showing
12 changed files
with
472 additions
and
9 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,36 @@ | ||
using BannerlordTwee.Parser; | ||
|
||
namespace BannerlordTwee.Test { | ||
[TestClass] | ||
public class ParseTitleTest { | ||
[TestMethod] | ||
public void TestStoryTitle() { | ||
var parser = new TweeParser(""); | ||
var title = parser.ParseTitle(":: StoryTitle"); | ||
Assert.AreEqual(title.Name, "StoryTitle"); | ||
Assert.AreEqual(title.OtherIsEmpty, true); | ||
Assert.AreEqual(title.IsStoryTitle, true); | ||
Assert.AreEqual(title.IsStoryData, false); | ||
} | ||
[TestMethod] | ||
public void TestStoryData() { | ||
var parser = new TweeParser(""); | ||
var title = parser.ParseTitle(":: StoryData"); | ||
Assert.AreEqual(title.Name, "StoryData"); | ||
Assert.AreEqual(title.OtherIsEmpty, true); | ||
Assert.AreEqual(title.IsStoryTitle, false); | ||
Assert.AreEqual(title.IsStoryData, true); | ||
} | ||
[TestMethod] | ||
public void TestNormal_1() { | ||
var parser = new TweeParser(""); | ||
var title = parser.ParseTitle(":: ÏÂÒ»Ïî {\"position\":\"900,625\",\"size\":\"100,100\"}"); | ||
Assert.AreEqual(title.Name, "ÏÂÒ»Ïî"); | ||
Assert.AreEqual(title.OtherIsEmpty, false); | ||
Assert.AreEqual(title.IsStoryTitle, false); | ||
Assert.AreEqual(title.IsStoryData, false); | ||
Assert.AreEqual(title.Size, "100,100"); | ||
Assert.AreEqual(title.Tags, null) | ||
Check failure on line 33 in BannerlordTwee.Test/ParseTitleTest.cs GitHub Actions / build
|
||
} | ||
} | ||
} |
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,56 @@ | ||
:: StoryTitle | ||
1 | ||
|
||
|
||
:: StoryData | ||
{ | ||
"ifid": "6B2EFB77-3101-4602-B826-06BBFDD3D345", | ||
"format": "Harlowe", | ||
"format-version": "3.3.6", | ||
"start": "开始", | ||
"tag-colors": { | ||
"tag2": "red", | ||
"taga": "orange" | ||
}, | ||
"zoom": 1 | ||
} | ||
|
||
|
||
:: 下一项 {"position":"900,625","size":"100,100"} | ||
这里是下一项 | ||
|
||
|
||
:: 下一项2 {"position":"1050,575","size":"100,100"} | ||
这里是下一项2 | ||
|
||
|
||
:: 开始 {"position":"700,325","size":"100,100"} | ||
啊啊啊 | ||
|
||
<!--Comment Text--> | ||
|
||
[[选项1->这是选项1]] | ||
[[选项2->这是选项2]] | ||
[[选项3]] | ||
|
||
\:: | ||
|
||
|
||
:: 这是选项1 [tag1 tag2 taga] {"position":"950,125","size":"100,100"} | ||
不是很好 | ||
|
||
[[选项3]] | ||
[[这是选项2]] | ||
[[返回->开始]] | ||
|
||
|
||
|
||
:: 这是选项2 {"position":"875,475","size":"100,100"} | ||
这里是选项2 | ||
|
||
[[下一项]] | ||
[[第二个->下一项2]] | ||
|
||
|
||
:: 选项3 [tagme] {"position":"1050,325","size":"100,100"} | ||
这里是选项3 |
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,56 @@ | ||
:: StoryTitle | ||
1 | ||
|
||
|
||
:: StoryData | ||
{ | ||
"ifid": "6B2EFB77-3101-4602-B826-06BBFDD3D345", | ||
"format": "Harlowe", | ||
"format-version": "3.3.6", | ||
"start": "开始", | ||
"tag-colors": { | ||
"tag2": "red", | ||
"taga": "orange" | ||
}, | ||
"zoom": 1 | ||
} | ||
|
||
|
||
:: StoryData {"position":"1050,575","size":"100,100"} | ||
这里是下一项2 | ||
|
||
|
||
:: StoryTitle {"position":"900,625","size":"100,100"} | ||
这里是下一项 | ||
|
||
|
||
:: 开始 {"position":"700,325","size":"100,100"} | ||
啊啊啊 | ||
|
||
<!--Comment Text--> | ||
|
||
[[选项1->这是选项1]] | ||
[[选项2->这是选项2]] | ||
[[选项3]] | ||
|
||
\:: | ||
|
||
|
||
:: 这是选项1 [tag1 tag2 taga] {"position":"950,125","size":"100,100"} | ||
不是很好 | ||
|
||
[[选项3]] | ||
[[这是选项2]] | ||
[[返回->开始]] | ||
|
||
|
||
|
||
:: 这是选项2 {"position":"875,475","size":"100,100"} | ||
这里是选项2 | ||
|
||
[[StoryTitle]] | ||
[[第二个->StoryData]] | ||
|
||
|
||
:: 选项3 [tagme] {"position":"1050,325","size":"100,100"} | ||
这里是选项3 |
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,56 @@ | ||
:: StoryTitle | ||
1 | ||
|
||
|
||
:: StoryData | ||
{ | ||
"ifid": "6B2EFB77-3101-4602-B826-06BBFDD3D345", | ||
"format": "Harlowe", | ||
"format-version": "3.3.6", | ||
"start": "开始", | ||
"tag-colors": { | ||
"tag2": "red", | ||
"taga": "orange" | ||
}, | ||
"zoom": 1 | ||
} | ||
|
||
|
||
:: StoryData {"position":"1050,575","size":"100,100"} | ||
这里是下一项2 | ||
|
||
|
||
:: StoryTitle {"position":"900,625","size":"100,100"} | ||
这里是下一项 | ||
|
||
|
||
:: 开始 {"position":"700,325","size":"100,100"} | ||
啊啊啊 | ||
|
||
<!--Comment Text--> | ||
|
||
[[选项1->这是选项1]] | ||
[[选项2->这是选项2]] | ||
[[选项3]] | ||
|
||
\:: | ||
|
||
|
||
:: 这是选项1 [tag1 tag2 taga] {"position":"950,125","size":"100,100"} | ||
不是很好 | ||
|
||
[[选项3]] | ||
[[这是选项2]] | ||
[[返回->开始]] | ||
|
||
|
||
|
||
:: 这是选项2 {"position":"875,475","size":"100,100"} | ||
这里是选项2 | ||
|
||
[[StoryTitle]] | ||
[[第二个->StoryData]] | ||
|
||
|
||
:: 选项3 [tagme \[a\]] {"position":"1050,325","size":"100,100"} | ||
这里是选项3 |
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,56 @@ | ||
:: StoryTitle | ||
1 | ||
|
||
|
||
:: StoryData | ||
{ | ||
"ifid": "6B2EFB77-3101-4602-B826-06BBFDD3D345", | ||
"format": "Harlowe", | ||
"format-version": "3.3.6", | ||
"start": "开始", | ||
"tag-colors": { | ||
"tag2": "red", | ||
"taga": "orange" | ||
}, | ||
"zoom": 1 | ||
} | ||
|
||
|
||
:: StoryData {"position":"1050,575","size":"100,100"} | ||
这里是下一项2 | ||
|
||
|
||
:: StoryTitle {"position":"900,625","size":"100,100"} | ||
这里是下一项 | ||
|
||
|
||
:: 开始 {"position":"700,325","size":"100,100"} | ||
啊啊啊 | ||
|
||
<!--Comment Text--> | ||
|
||
[[选项1->这是选项1]] | ||
[[选项2->这是选项2]] | ||
[[选项3]] | ||
|
||
\:: | ||
|
||
|
||
:: 这是选项1 [tag1 tag2 taga] {"position":"950,125","size":"100,100"} | ||
不是很好 | ||
|
||
[[选项3]] | ||
[[这是选项2]] | ||
[[返回->开始]] | ||
|
||
|
||
|
||
:: 这是选项2 {"position":"875,475","size":"100,100"} | ||
这里是选项2 | ||
|
||
[[StoryTitle]] | ||
[[第二个->StoryData]] | ||
|
||
|
||
:: 选项3 [tagme \[a\] \{b\}] {"position":"1050,325","size":"100,100"} | ||
这里是选项3 |
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,56 @@ | ||
:: StoryTitle | ||
1 | ||
|
||
|
||
:: StoryData | ||
{ | ||
"ifid": "6B2EFB77-3101-4602-B826-06BBFDD3D345", | ||
"format": "Harlowe", | ||
"format-version": "3.3.6", | ||
"start": "开始", | ||
"tag-colors": { | ||
"tag2": "red", | ||
"taga": "orange" | ||
}, | ||
"zoom": 1 | ||
} | ||
|
||
|
||
:: StoryData {"position":"1050,575","size":"100,100"} | ||
这里是下一项2 | ||
|
||
|
||
:: StoryTitle {"position":"900,625","size":"100,100"} | ||
这里是下一项 | ||
|
||
|
||
:: 开始 {"position":"700,325","size":"100,100"} | ||
啊啊啊 | ||
|
||
<!--Comment Text--> | ||
|
||
[[选项1->这是选项1]] | ||
[[选项2->这是选项2]] | ||
[[选项3]] | ||
|
||
\:: | ||
|
||
|
||
:: 这是选项1 [tag1 tag2 taga] {"position":"950,125","size":"100,100"} | ||
不是很好 | ||
|
||
[[选项3]] | ||
[[这是选项2]] | ||
[[返回->开始]] | ||
|
||
|
||
|
||
:: 这是选项2 {"position":"875,475","size":"100,100"} | ||
这里是选项2 | ||
|
||
[[StoryTitle]] | ||
[[第二个->StoryData]] | ||
|
||
|
||
:: 选项3 [tagme \[a\] \{b\} aa---a] {"position":"1050,325","size":"100,100"} | ||
这里是选项3 |
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,56 @@ | ||
:: StoryTitle | ||
1 | ||
|
||
|
||
:: StoryData | ||
{ | ||
"ifid": "6B2EFB77-3101-4602-B826-06BBFDD3D345", | ||
"format": "Harlowe", | ||
"format-version": "3.3.6", | ||
"start": "开始", | ||
"tag-colors": { | ||
"tag2": "red", | ||
"taga": "orange" | ||
}, | ||
"zoom": 1 | ||
} | ||
|
||
|
||
:: StoryData {"position":"1050,575","size":"100,100"} | ||
这里是下一项2 | ||
|
||
|
||
:: StoryTitle {"position":"900,625","size":"100,100"} | ||
这里是下一项 | ||
|
||
|
||
:: 开始 {"position":"700,325","size":"100,100"} | ||
啊啊啊 | ||
|
||
<!--Comment Text--> | ||
|
||
[[选项1->这是选项1]] | ||
[[选项2->这是选项2]] | ||
[[选项 3]] | ||
|
||
\:: | ||
|
||
|
||
:: 这是选项1 [tag1 tag2 taga] {"position":"950,125","size":"100,100"} | ||
不是很好 | ||
|
||
[[选项 3]] | ||
[[这是选项2]] | ||
[[返回->开始]] | ||
|
||
|
||
|
||
:: 这是选项2 {"position":"875,475","size":"100,100"} | ||
这里是选项2 | ||
|
||
[[StoryTitle]] | ||
[[第二个->StoryData]] | ||
|
||
|
||
:: 选项 3 [tagme \[a\] \{b\} aa---a] {"position":"1050,325","size":"100,100"} | ||
这里是选项3 |
Oops, something went wrong.