mirror of
https://github.com/Stone-Red-Code/YesNt-Interpreter.git
synced 2026-09-09 07:56:06 +02:00
Upgrade to .NET 10, update packages, enable AOT and cleanup code
This commit is contained in:
@@ -4,7 +4,6 @@ using System.Collections.Generic;
|
||||
|
||||
using YesNt.Interpreter.Attributes;
|
||||
using YesNt.Interpreter.Enums;
|
||||
using YesNt.Interpreter.Runtime;
|
||||
|
||||
namespace YesNt.Interpreter.Tests;
|
||||
|
||||
@@ -21,7 +20,7 @@ public class AddStatementTests
|
||||
|
||||
string? capturedArgs = null;
|
||||
|
||||
YesNtAssert.GetLastLineWithSetup(lines, interpreter =>
|
||||
_ = YesNtAssert.GetLastLineWithSetup(lines, interpreter =>
|
||||
{
|
||||
interpreter.AddStatement("my_command", SearchMode.StartOfLine, SpaceAround.End, args =>
|
||||
{
|
||||
@@ -42,7 +41,7 @@ public class AddStatementTests
|
||||
|
||||
bool handlerCalled = false;
|
||||
|
||||
YesNtAssert.GetLastLineWithSetup(lines, interpreter =>
|
||||
_ = YesNtAssert.GetLastLineWithSetup(lines, interpreter =>
|
||||
{
|
||||
interpreter.AddStatement("custom_cmd", SearchMode.StartOfLine, SpaceAround.End, _ =>
|
||||
{
|
||||
@@ -63,9 +62,9 @@ public class AddStatementTests
|
||||
|
||||
bool handlerCalled = false;
|
||||
|
||||
YesNtAssert.GetLastLineWithSetup(lines, interpreter =>
|
||||
_ = YesNtAssert.GetLastLineWithSetup(lines, interpreter =>
|
||||
{
|
||||
var attr = new StatementAttribute("attr_cmd", SearchMode.StartOfLine, SpaceAround.End);
|
||||
StatementAttribute attr = new StatementAttribute("attr_cmd", SearchMode.StartOfLine, SpaceAround.End);
|
||||
interpreter.AddStatement(attr, _ =>
|
||||
{
|
||||
handlerCalled = true;
|
||||
@@ -85,7 +84,7 @@ public class AddStatementTests
|
||||
|
||||
bool handlerCalled = false;
|
||||
|
||||
YesNtAssert.GetLastLineWithSetup(lines, interpreter =>
|
||||
_ = YesNtAssert.GetLastLineWithSetup(lines, interpreter =>
|
||||
{
|
||||
interpreter.AddStatement("exact_cmd", SearchMode.Exact, SpaceAround.None, _ =>
|
||||
{
|
||||
@@ -106,7 +105,7 @@ public class AddStatementTests
|
||||
|
||||
bool handlerCalled = false;
|
||||
|
||||
YesNtAssert.GetLastLineWithSetup(lines, interpreter =>
|
||||
_ = YesNtAssert.GetLastLineWithSetup(lines, interpreter =>
|
||||
{
|
||||
interpreter.AddStatement(" ~mark~ ", SearchMode.Contains, SpaceAround.None, _ =>
|
||||
{
|
||||
@@ -127,7 +126,7 @@ public class AddStatementTests
|
||||
|
||||
bool handlerCalled = false;
|
||||
|
||||
YesNtAssert.GetLastLineWithSetup(lines, interpreter =>
|
||||
_ = YesNtAssert.GetLastLineWithSetup(lines, interpreter =>
|
||||
{
|
||||
interpreter.AddStatement(" !end", SearchMode.EndOfLine, SpaceAround.None, _ =>
|
||||
{
|
||||
@@ -148,7 +147,7 @@ public class AddStatementTests
|
||||
|
||||
string? capturedArgs = null;
|
||||
|
||||
YesNtAssert.GetLastLineWithSetup(lines, interpreter =>
|
||||
_ = YesNtAssert.GetLastLineWithSetup(lines, interpreter =>
|
||||
{
|
||||
interpreter.AddStatement("capture_cmd", SearchMode.StartOfLine, SpaceAround.End, args =>
|
||||
{
|
||||
@@ -279,7 +278,7 @@ public class AddStatementTests
|
||||
int highPriorityOrder = -1;
|
||||
int normalPriorityOrder = -1;
|
||||
|
||||
YesNtAssert.GetLastLineWithSetup(lines, interpreter =>
|
||||
_ = YesNtAssert.GetLastLineWithSetup(lines, interpreter =>
|
||||
{
|
||||
interpreter.AddStatement(
|
||||
new StatementAttribute("priority_cmd", SearchMode.StartOfLine, SpaceAround.End) { Priority = Priority.High },
|
||||
|
||||
@@ -217,7 +217,6 @@ public class CodeFlowTests
|
||||
YesNtAssert.IsLastLineEqual(lines, "yes");
|
||||
}
|
||||
|
||||
|
||||
[TestMethod]
|
||||
public void LabelWithoutColonFailsTest()
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ConsoleStatementsTests
|
||||
"clear"
|
||||
];
|
||||
|
||||
_ = Assert.ThrowsException<IOException>(() => YesNtAssert.GetLastLine(lines));
|
||||
_ = Assert.Throws<IOException>(() => YesNtAssert.GetLastLine(lines));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@@ -80,7 +80,7 @@ public class ConsoleStatementsTests
|
||||
{
|
||||
YesNtInterpreter interpreter = new YesNtInterpreter();
|
||||
|
||||
AutoResetEvent onDone= new AutoResetEvent(false);
|
||||
AutoResetEvent onDone = new AutoResetEvent(false);
|
||||
StringBuilder output = new StringBuilder();
|
||||
|
||||
interpreter.OnDebugOutput += (s) => _ = output.Append(s);
|
||||
|
||||
@@ -150,7 +150,6 @@ public class FunctionStatementsTests
|
||||
YesNtAssert.IsLastLineEqual(lines, "outer");
|
||||
}
|
||||
|
||||
|
||||
[TestMethod]
|
||||
public void ClearCallStackRunsTest()
|
||||
{
|
||||
|
||||
@@ -88,7 +88,6 @@ public class ProcessingStatementsTests
|
||||
YesNtAssert.IsLastLineEqual(lines, "ok");
|
||||
}
|
||||
|
||||
|
||||
[TestMethod]
|
||||
public void SleepInvalidValueFailsTest()
|
||||
{
|
||||
|
||||
@@ -118,7 +118,6 @@ public class VariableStatementsTests
|
||||
YesNtAssert.IsLastLineEqual(lines, "0");
|
||||
}
|
||||
|
||||
|
||||
[TestMethod]
|
||||
public void MissingVariableReferenceFailsTest()
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
@@ -10,10 +10,13 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.7" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.7" />
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="4.1.0" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="4.1.0" />
|
||||
<PackageReference Include="coverlet.collector" Version="8.0.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user