-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #252 from adrianoc/vnext
August 2023 updates
- Loading branch information
Showing
34 changed files
with
1,043 additions
and
316 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<Project> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp"><Version>4.6.0-1.final</Version></PackageReference> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp"><Version>4.7.0-2.final</Version></PackageReference> | ||
<PackageReference Include="Mono.Cecil"><Version>0.11.5</Version></PackageReference> | ||
</ItemGroup> | ||
</Project> |
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
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,28 @@ | ||
using NUnit.Framework; | ||
|
||
namespace Cecilifier.Core.Tests.Tests.Unit; | ||
|
||
[TestFixture] | ||
public class CastTests : CecilifierUnitTestBase | ||
{ | ||
[Test] | ||
public void Unbox() | ||
{ | ||
var result = RunCecilifier("int UnboxIt(object o) => (int) o;"); | ||
Assert.That(result.GeneratedCode.ReadToEnd(), Does.Match(""" | ||
(il_unboxIt_\d+\.Emit\(OpCodes\.)Ldarg_1\); | ||
\s+\1Unbox_Any, assembly.MainModule.TypeSystem.Int32\); | ||
""")); | ||
} | ||
|
||
[TestCase("i", TestName = "Implicit boxing")] | ||
[TestCase("(object) i", TestName = "Explicit boxing")] | ||
public void Box(string expression) | ||
{ | ||
var result = RunCecilifier($"object BoxIt(int i) => {expression};"); | ||
Assert.That(result.GeneratedCode.ReadToEnd(), Does.Match(""" | ||
(il_boxIt_\d+\.Emit\(OpCodes\.)Ldarg_1\); | ||
\s+\1Box, assembly.MainModule.TypeSystem.Int32\); | ||
""")); | ||
} | ||
} |
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
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
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
Oops, something went wrong.