diff --git a/.gitpod.yml b/.gitpod.yml index 26e2f8e..a5d88c8 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,5 +1,5 @@ image: gitpod/workspace-dotnet tasks: - - name: Setup and test - command: cd csharp && dotnet test -c Release -f net8 \ No newline at end of file + - name: Test + command: (cd csharp && dotnet test -c Release -f net8) \ No newline at end of file diff --git a/csharp/Platform.Protocols.Lino.Tests/ParserTests.cs b/csharp/Platform.Protocols.Lino.Tests/ParserTests.cs index c088085..8145f24 100644 --- a/csharp/Platform.Protocols.Lino.Tests/ParserTests.cs +++ b/csharp/Platform.Protocols.Lino.Tests/ParserTests.cs @@ -182,5 +182,39 @@ public static void QuotedReferencesWithSpacesTest() var formattedLinks = links.Format(); Assert.Equal(target, formattedLinks); } + + [Fact] + public static void EmptyLinkTest() + { + var source = @":"; + var target = @":"; + var parser = new Parser(); + var links = parser.Parse(source); + var formattedLinks = links.Format(); + Assert.Equal(target, formattedLinks); + } + + + [Fact] + public static void EmptyLinkWithParenthesesTest() + { + var source = @"()"; + var target = @"()"; + var parser = new Parser(); + var links = parser.Parse(source); + var formattedLinks = links.Format(); + Assert.Equal(target, formattedLinks); + } + + [Fact] + public static void EmptyLinkWithEmptySelfReferenceTest() + { + var source = @"(:)"; + var target = @"(:)"; + var parser = new Parser(); + var links = parser.Parse(source); + var formattedLinks = links.Format(); + Assert.Equal(target, formattedLinks); + } } }