Fix circular type init (#16)

This commit is contained in:
Patrick Stevens
2025-05-26 16:18:57 +01:00
committed by GitHub
parent 0b10ccedfd
commit 3ef25c27f3
14 changed files with 459 additions and 145 deletions

View File

@@ -25,7 +25,7 @@ module TestBasicLock =
try
let terminalState, terminatingThread =
Program.run loggerFactory peImage dotnetRuntimes []
Program.run loggerFactory (Some "BasicLock.cs") peImage dotnetRuntimes []
let exitCode =
match terminalState.ThreadState.[terminatingThread].MethodState.EvaluationStack.Values with

View File

@@ -19,12 +19,12 @@ module TestCases =
ExpectedReturnCode = 10
}
{
FileName = "WriteLine.cs"
FileName = "BasicLock.cs"
ExpectedReturnCode = 10
}
{
FileName = "BasicLock.cs"
ExpectedReturnCode = 10
FileName = "WriteLine.cs"
ExpectedReturnCode = 1
}
]
@@ -53,7 +53,7 @@ module TestCases =
try
let terminalState, terminatingThread =
Program.run loggerFactory peImage dotnetRuntimes []
Program.run loggerFactory (Some case.FileName) peImage dotnetRuntimes []
let exitCode =
match terminalState.ThreadState.[terminatingThread].MethodState.EvaluationStack.Values with
@@ -73,7 +73,7 @@ module TestCases =
[<TestCaseSource(nameof unimplemented)>]
[<Explicit "not yet implemented">]
let ``Can evaluate C# files (unimplemented)`` (case : TestCase) : unit =
let ``Can evaluate C# files, unimplemented`` (case : TestCase) : unit =
let source = Assembly.getEmbeddedResourceAsString case.FileName assy
let image = Roslyn.compile [ source ]
let messages, loggerFactory = LoggerFactory.makeTest ()
@@ -85,7 +85,7 @@ module TestCases =
try
let terminalState, terminatingThread =
Program.run loggerFactory peImage dotnetRuntimes []
Program.run loggerFactory (Some case.FileName) peImage dotnetRuntimes []
let exitCode =
match terminalState.ThreadState.[terminatingThread].MethodState.EvaluationStack.Values with

View File

@@ -26,7 +26,7 @@ module TestHelloWorld =
use peImage = new MemoryStream (image)
let terminalState, terminatingThread =
Program.run loggerFactory peImage dotnetRuntimes []
Program.run loggerFactory (Some "HelloWorld.cs") peImage dotnetRuntimes []
let exitCode =
match terminalState.ThreadState.[terminatingThread].MethodState.EvaluationStack.Values with

View File

@@ -7,7 +7,7 @@ namespace HelloWorldApp
static int Main(string[] args)
{
Console.WriteLine("Hello, world!");
return 0;
return 1;
}
}
}