Skip to content

Commit

Permalink
Added test for Turtle Unicode surrogate parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
mdesalvo committed Nov 23, 2023
1 parent d814f32 commit 7b4f5b3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions RDFSharp.Test/Model/Serializers/RDFTurtleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4125,6 +4125,19 @@ public void ShouldDeserializeGraphWithSPLTDoubleNegativeValuePositiveExponentTri
Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("http://subj/"), new RDFResource("http://pred/"), new RDFTypedLiteral("-2.02E5", RDFModelEnums.RDFDatatypes.XSD_DOUBLE))));
}

[TestMethod]
public void ShouldDeserializeGraphWithSPLUnicodeSurrogateTriple()
{
MemoryStream stream = new MemoryStream();
using (StreamWriter writer = new StreamWriter(stream))
writer.WriteLine($"@base <{RDFNamespaceRegister.DefaultNamespace}>.{Environment.NewLine}<http://subj/> <http://pred/> \"🌀🏯\".");
RDFGraph graph = RDFTurtle.Deserialize(new MemoryStream(stream.ToArray()), null);

Assert.IsNotNull(graph);
Assert.IsTrue(graph.TriplesCount == 1);
Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("http://subj/"), new RDFResource("http://pred/"), new RDFPlainLiteral("🌀🏯"))));
}

[TestMethod]
public void ShouldDeserializeGraphWithBPLTriple()
{
Expand Down

0 comments on commit 7b4f5b3

Please sign in to comment.