Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for UTF8 in words #139

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions USFMToolsSharpTest/USFMParserTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,20 @@ public void TestWordEntryParse()
Assert.AreEqual("H1234,G5485", ((WMarker)parser.ParseFromString("\\f + \\fr 3:5 \\fk berhala \\ft Lih. \\w gracious|strong=\"H1234,G5485\" \\w* di Daftar Istilah.\\f*").Contents[0].Contents[2].Contents[1]).Attributes["strong"]);
Assert.AreEqual("gnt5:51.1.2.1", ((WMarker)parser.ParseFromString("\\f + \\fr 3:5 \\fk berhala \\ft Lih. \\w gracious|lemma=\"grace\" srcloc=\"gnt5:51.1.2.1\" \\w* di Daftar Istilah.\\f*").Contents[0].Contents[2].Contents[1]).Attributes["srcloc"]);
Assert.AreEqual("metadata", ((WMarker)parser.ParseFromString("\\f + \\fr 3:5 \\fk berhala \\ft Lih. \\w gracious|lemma=\"grace\" x-myattr=\"metadata\" srcloc=\"gnt5:51.1.2.1\" \\w* di Daftar Istilah.\\f*").Contents[0].Contents[2].Contents[1]).Attributes["x-myattr"]);
}

[TestMethod]
public void TestUtf8WordEntryParse()
{
var parsed =
parser.ParseFromString("\\w Δαυεὶδ|lemma=\"Δαυείδ\" strong=\"G11380\" x-morph=\"Gr,N,,,,,GMSI\"\\w*");
Assert.AreEqual("Δαυεὶδ", ((WMarker)parsed.Contents[0]).Term);
Assert.AreEqual("Δαυείδ", ((WMarker)parsed.Contents[0]).Attributes["lemma"]);
Assert.AreEqual("G11380", ((WMarker)parsed.Contents[0]).Attributes["strong"]);
Assert.AreEqual("Gr,N,,,,,GMSI", ((WMarker)parsed.Contents[0]).Attributes["x-morph"]);
}


[TestMethod]
public void TestPoetryParse()
{
Expand Down