From 83b9a36dc8dd10f1bb2f8360e8a96392fba1d8fb Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Sat, 29 Jun 2024 12:36:58 -0600 Subject: [PATCH] update packages --- Directory.Packages.props | 18 +++++++++--------- src/IxMilia.Lisp.DebugAdapter/DebugAdapter.cs | 2 ++ .../InvocationArgumentTests.cs | 18 +++++++++--------- src/IxMilia.Lisp.Test/ObjectReadTestsBase.cs | 4 ++-- src/IxMilia.Lisp.Test/TestBase.cs | 2 +- 5 files changed, 23 insertions(+), 21 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 43245d7..d0c0a95 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,14 +1,14 @@ - - + + - - - - - - - + + + + + + + diff --git a/src/IxMilia.Lisp.DebugAdapter/DebugAdapter.cs b/src/IxMilia.Lisp.DebugAdapter/DebugAdapter.cs index 6893329..7870855 100644 --- a/src/IxMilia.Lisp.DebugAdapter/DebugAdapter.cs +++ b/src/IxMilia.Lisp.DebugAdapter/DebugAdapter.cs @@ -303,7 +303,9 @@ private async Task LaunchAsync(LaunchRequest launch) _host.RootFrame.ErrorOccurred += RootFrame_ErrorOccurred; _host.RootFrame.EvaluatingExpression += RootFrame_EvaluatingExpression; _host.RootFrame.FunctionEntered += RootFrame_FunctionEntered; +#pragma warning disable VSTHRD003 // Avoid awaiting foreign Tasks await _configurationDone.Task; +#pragma warning restore VSTHRD003 // Avoid awaiting foreign Tasks _executionState.InsertCodeOperations(launch.Arguments.Program, fileContent); PushMessage(new LaunchResponse(GetNextSeq(), launch.Seq)); await ContinueEvaluationAsync(); diff --git a/src/IxMilia.Lisp.Test/InvocationArgumentTests.cs b/src/IxMilia.Lisp.Test/InvocationArgumentTests.cs index c470206..6a13a38 100644 --- a/src/IxMilia.Lisp.Test/InvocationArgumentTests.cs +++ b/src/IxMilia.Lisp.Test/InvocationArgumentTests.cs @@ -62,7 +62,7 @@ public void BindOptionalArguments() new LispInteger(14)), LispSymbol.CreateFromString("SHOULD-BE-NIL") ); - Assert.Equal(1, argumentCollection.RegularArguments.Count); + Assert.Single(argumentCollection.RegularArguments); Assert.Equal(2, argumentCollection.OptionalArguments.Count); Assert.Empty(argumentCollection.KeywordArguments); Assert.Empty(argumentCollection.AuxiliaryArguments); @@ -87,7 +87,7 @@ public void BindKeywordArguments() new LispInteger(14)), LispSymbol.CreateFromString("SHOULD-BE-NIL") ); - Assert.Equal(1, argumentCollection.RegularArguments.Count); + Assert.Single(argumentCollection.RegularArguments); Assert.Empty(argumentCollection.OptionalArguments); Assert.Equal(2, argumentCollection.KeywordArguments.Count); Assert.Empty(argumentCollection.AuxiliaryArguments); @@ -110,7 +110,7 @@ public void BindAuxiliaryArguments() new LispInteger(2)), LispSymbol.CreateFromString("NNIILL") ); - Assert.Equal(1, argumentCollection.RegularArguments.Count); + Assert.Single(argumentCollection.RegularArguments); Assert.Empty(argumentCollection.OptionalArguments); Assert.Empty(argumentCollection.KeywordArguments); Assert.Equal(2, argumentCollection.AuxiliaryArguments.Count); @@ -132,7 +132,7 @@ public void BindRestArgument() new LispLambdaListKeyword("&REST"), LispSymbol.CreateFromString("THE-REST") ); - Assert.Equal(1, argumentCollection.RegularArguments.Count); + Assert.Single(argumentCollection.RegularArguments); Assert.Empty(argumentCollection.OptionalArguments); Assert.Empty(argumentCollection.KeywordArguments); Assert.NotNull(argumentCollection.RestArgument); @@ -154,9 +154,9 @@ public void BindOptionalAndKeywordAndRestArguments() new LispLambdaListKeyword("&REST"), LispSymbol.CreateFromString("THE-REST") ); - Assert.Equal(1, argumentCollection.RegularArguments.Count); - Assert.Equal(1, argumentCollection.OptionalArguments.Count); - Assert.Equal(1, argumentCollection.KeywordArguments.Count); + Assert.Single(argumentCollection.RegularArguments); + Assert.Single(argumentCollection.OptionalArguments); + Assert.Single(argumentCollection.KeywordArguments); Assert.NotNull(argumentCollection.RestArgument); Assert.Equal("A", argumentCollection.RegularArguments[0].Name); @@ -453,8 +453,8 @@ public void MatchKeywordAndOptionalAndRestArgumentsWithValues() Assert.Equal("THE-REST", matched[3].Item1.Name); var rest = ((LispList)matched[3].Item2).ToList(); - Assert.Equal(1, rest.Count); - Assert.Equal(4, ((LispInteger)rest[0]).Value); + var remainder = Assert.Single(rest); + Assert.Equal(4, ((LispInteger)remainder).Value); } [Fact] diff --git a/src/IxMilia.Lisp.Test/ObjectReadTestsBase.cs b/src/IxMilia.Lisp.Test/ObjectReadTestsBase.cs index bc960f7..90fe903 100644 --- a/src/IxMilia.Lisp.Test/ObjectReadTestsBase.cs +++ b/src/IxMilia.Lisp.Test/ObjectReadTestsBase.cs @@ -468,8 +468,8 @@ public async Task ReadTableCopying() public async Task BackQuoteReadAndEval(string code, string expected, string alternateExpected = null) { var (host, readResult) = await ReadHostAndResultAsync(code); - var evalResult = host.EvalAsync(readResult, host.CreateExecutionState()); - var actual = evalResult.Result.Value.ToDisplayString(host.CurrentPackage); + var evalResult = await host.EvalAsync(readResult, host.CreateExecutionState()); + var actual = evalResult.Value.ToDisplayString(host.CurrentPackage); Assert.True(expected == actual || alternateExpected == actual, $"Expected: {expected} or {alternateExpected}, Actual: {actual}"); } diff --git a/src/IxMilia.Lisp.Test/TestBase.cs b/src/IxMilia.Lisp.Test/TestBase.cs index 472df5d..191d099 100644 --- a/src/IxMilia.Lisp.Test/TestBase.cs +++ b/src/IxMilia.Lisp.Test/TestBase.cs @@ -55,7 +55,7 @@ protected static void EnsureNotError(LispObject obj) { if (obj is LispError error) { - Assert.True(false, $"{error.Message} at {error.SourceLocation}"); + Assert.Fail($"{error.Message} at {error.SourceLocation}"); } }