Skip to content

Commit

Permalink
Fix nullability warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lilith committed Jan 29, 2024
1 parent 431e672 commit c25ccfe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Tomlyn.Tests/SyntaxTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void Sample()
}

class PropMetaTestDoc : ITomlMetadataProvider{
public PropMetaTestTable Mytable {get; set;}
public PropMetaTestTable? Mytable {get; set;}
public TomlPropertiesMetadata? PropertiesMetadata { get; set; }
}
class PropMetaTestTable : ITomlMetadataProvider{
Expand All @@ -118,8 +118,8 @@ public void TestPropertySpan()
var doc = Toml.Parse(input);

var instance = doc.ToModel<PropMetaTestDoc>();
Assert.True(instance.Mytable.PropertiesMetadata?.ContainsProperty("key"));
if (instance.Mytable.PropertiesMetadata?.TryGetProperty("key", out var keyMeta) == true){
Assert.True(instance.Mytable?.PropertiesMetadata?.ContainsProperty("key"));
if (instance.Mytable?.PropertiesMetadata?.TryGetProperty("key", out var keyMeta) == true){
Assert.That(keyMeta.Span.Start.Line, Is.EqualTo(1));
Assert.That(keyMeta.Span.Start.Column, Is.EqualTo(0));
Assert.That(keyMeta.Span.End.Line, Is.EqualTo(1));
Expand Down

0 comments on commit c25ccfe

Please sign in to comment.