Skip to content

Commit

Permalink
fix broken test expectations
Browse files Browse the repository at this point in the history
Due to issue #277 tests were expecting DateTime to be resolved to 'assembly.MainModule.TypeSystem.DateTime'
  • Loading branch information
adrianoc committed Apr 11, 2024
1 parent 6b2e8da commit e0218f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Cecilifier.Core.Tests/Tests/Unit/ArrayTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class ArrayTests : CecilifierUnitTestBase
[TestCase("long", Code.Ldelem_I8)]
[TestCase("float", Code.Ldelem_R4)]
[TestCase("double", Code.Ldelem_R8)]
[TestCase("System.DateTime", Code.Ldelem_Any, ", assembly.MainModule.TypeSystem.DateTime")]
[TestCase("System.DateTime", Code.Ldelem_Any, @", .+ImportReference\(typeof\(System.DateTime\)\)")]
public void TestAccessStringArray(string elementType, Code code, string operand = "")
{
var result = RunCecilifier($@"struct S {{}} class C {{ {elementType} M({elementType} []a) => a[2]; }}");
Expand All @@ -41,7 +41,7 @@ public void TestAccessStringArray(string elementType, Code code, string operand
[TestCase("long", Code.Stelem_I8)]
[TestCase("float", Code.Stelem_R4)]
[TestCase("double", Code.Stelem_R8)]
[TestCase("System.DateTime", Code.Stelem_Any, ", assembly.MainModule.TypeSystem.DateTime")]
[TestCase("System.DateTime", Code.Stelem_Any, @", .+ImportReference\(typeof\(System.DateTime\)\)")]
[TestCase("S", Code.Stelem_Any, @", st_S_\d+")]
public void TestArrayInstantiation(string elementType, Code code, string operand = "")
{
Expand All @@ -68,7 +68,7 @@ public void TestArrayInstantiation(string elementType, Code code, string operand
[TestCase("System.Int64")]
[TestCase("System.Single")]
[TestCase("System.Double")]
[TestCase("System.DateTime")]
[TestCase("System.DateTime", @".+ImportReference\(typeof\(System.DateTime\)\)")]
[TestCase("S", @"st_S_\d+")]
public void TestJaggedArrayInstantiation(string elementType, string operand = null)
{
Expand Down Expand Up @@ -97,7 +97,7 @@ public void TestJaggedArrayInstantiation(string elementType, string operand = nu
[TestCase("long", Code.Stelem_I8)]
[TestCase("float", Code.Stelem_R4)]
[TestCase("double", Code.Stelem_R8)]
[TestCase("System.DateTime", Code.Stelem_Any, ", assembly.MainModule.TypeSystem.DateTime")]
[TestCase("System.DateTime", Code.Stelem_Any, @", .+ImportReference\(typeof\(System.DateTime\)\)")]
[TestCase("S", Code.Stelem_Any, @", st_S_\d+")]
public void TestJaggedArrayAssignment(string elementType, Code code, string operand = "")
{
Expand Down
2 changes: 1 addition & 1 deletion Cecilifier.Core.Tests/Tests/Unit/Miscellaneous.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public void TestCallerArgumentExpressionAttribute_InvalidParameterName(string de
"System.DateTime d = new();",
"""
(il_topLevelMain_\d+).Emit\(OpCodes.Ldloca_S, l_d_\d+\);
\s+\1.Emit\(OpCodes.Initobj, assembly.MainModule.TypeSystem.DateTime\);
\s+\1.Emit\(OpCodes.Initobj, .+ImportReference\(typeof\(System.DateTime\)\)\);
""",
TestName = "Value Type")]

Expand Down

0 comments on commit e0218f3

Please sign in to comment.