-
-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better Identifier Emission & State Handling (#891)
- Loading branch information
1 parent
d40fdf3
commit 75c3600
Showing
2 changed files
with
82 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using Silk.NET.SilkTouch.Symbols; | ||
using Xunit; | ||
|
||
namespace Silk.NET.SilkTouch.Emitter.Tests; | ||
|
||
public sealed class IdentifierTests : EmitterTest | ||
{ | ||
[Fact] | ||
public void IdentifierHasNoLeadingTrivia() | ||
{ | ||
var node = Transform(new IdentifierSymbol("Test")); | ||
|
||
Assert.Empty(node.GetLeadingTrivia()); | ||
Assert.False(node.HasLeadingTrivia); | ||
} | ||
|
||
[Fact] | ||
public void IdentifierHasNoTrailingTrivia() | ||
{ | ||
var node = Transform(new IdentifierSymbol("Test")); | ||
|
||
Assert.Empty(node.GetTrailingTrivia()); | ||
Assert.False(node.HasTrailingTrivia); | ||
} | ||
|
||
[Fact] | ||
public void IdentifierIntegration() | ||
{ | ||
var node = Transform(new IdentifierSymbol("Test")); | ||
|
||
Assert.Equal("Test", node.ToFullString()); | ||
} | ||
} |