Skip to content

Commit

Permalink
Added tests for #42
Browse files Browse the repository at this point in the history
  • Loading branch information
Konard committed Feb 2, 2024
1 parent 386b876 commit 3004ee8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
image: gitpod/workspace-dotnet

tasks:
- name: Setup and test
command: cd csharp && dotnet test -c Release -f net8
- name: Test
command: (cd csharp && dotnet test -c Release -f net8)
34 changes: 34 additions & 0 deletions csharp/Platform.Protocols.Lino.Tests/ParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

0 comments on commit 3004ee8

Please sign in to comment.