Skip to content

Commit

Permalink
Merge pull request #2 from mgnslndh/master
Browse files Browse the repository at this point in the history
Added tests for date keys
  • Loading branch information
xoofx authored Mar 1, 2019
2 parents fb2b3fa + 4bc95b2 commit 7fd3bf4
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/Tomlyn.Tests/ModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,31 @@ public static void TestBasic()
Assert.AreEqual("yo", subTable["d"]);
}

[Test]
public void TestShortDateKey()
{
var input = "2018-01-01=123";

var syntax = Toml.Parse(input);
Assert.False(syntax.HasErrors, "The document should not have any errors");

var model = syntax.ToModel();
Assert.True(model.ContainsKey("2018-01-01"));
}


[Test]
public void TestFullDateKey()
{
var input = "\"1987-07-05T17:45:00Z\"=123";

var syntax = Toml.Parse(input);
Assert.False(syntax.HasErrors, "The document should not have any errors");

var model = syntax.ToModel();
Assert.True(model.ContainsKey("1987-07-05T17:45:00Z"));
}

[Test]
public static void TestTable()
{
Expand Down

0 comments on commit 7fd3bf4

Please sign in to comment.