From 347a8f3b18cbfe016272b5b6ffcf73939642e4dc Mon Sep 17 00:00:00 2001 From: Bruce Dunwiddie Date: Sun, 12 Apr 2020 22:47:29 -0500 Subject: [PATCH 1/3] Added regression test to verify null variable assignment functionality. --- Data_Eval/Tests/EvaluatorTests.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Data_Eval/Tests/EvaluatorTests.cs b/Data_Eval/Tests/EvaluatorTests.cs index 4492026..ee7ae22 100644 --- a/Data_Eval/Tests/EvaluatorTests.cs +++ b/Data_Eval/Tests/EvaluatorTests.cs @@ -181,5 +181,19 @@ public void Evaluator_DynamicVariable() Assert.AreEqual("something", evaluator.Eval()); } + + [Test] + public void Evaluator_NullVariableComparison() + { + var evaluator = new Evaluator( + "return test == null"); + + evaluator.SetVariable( + "test", + null, + typeof(string)); + + Assert.IsTrue(evaluator.Eval()); + } } } From 369b8e1086a417c423e96b99fd2dc0205309e07c Mon Sep 17 00:00:00 2001 From: Bruce Dunwiddie Date: Thu, 16 Apr 2020 00:42:28 -0500 Subject: [PATCH 2/3] Implemented same logic to add reference for variable types behind the scenes for the Exec method same as the Eval method. --- Data_Eval/Data_Eval/Evaluator.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Data_Eval/Data_Eval/Evaluator.cs b/Data_Eval/Data_Eval/Evaluator.cs index 4dab68b..6572c1c 100644 --- a/Data_Eval/Data_Eval/Evaluator.cs +++ b/Data_Eval/Data_Eval/Evaluator.cs @@ -321,6 +321,13 @@ private void InitExec(string caller) { references.Add(caller); + // add references to containing assemblies for all used variable types + variables + .Select(v => v.Value.Type.Assembly.Location) + .Distinct() + .ToList() + .ForEach(a => references.Add(a)); + execution = new Execution(); Compiler compiler = new Compiler(); From c01d1478a15fbc82e14e9a521779307e2ded921c Mon Sep 17 00:00:00 2001 From: Bruce Dunwiddie Date: Fri, 17 Apr 2020 01:07:17 -0500 Subject: [PATCH 3/3] Incrementing version number for release. --- Data_Eval/Data_Eval/Data_Eval.csproj | 2 +- Data_Eval/Data_Eval/Data_Eval.nuspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Data_Eval/Data_Eval/Data_Eval.csproj b/Data_Eval/Data_Eval/Data_Eval.csproj index 20081b1..15d7997 100644 --- a/Data_Eval/Data_Eval/Data_Eval.csproj +++ b/Data_Eval/Data_Eval/Data_Eval.csproj @@ -7,7 +7,7 @@ true false Data_Eval.snk - 2.4.3 + 2.4.4 diff --git a/Data_Eval/Data_Eval/Data_Eval.nuspec b/Data_Eval/Data_Eval/Data_Eval.nuspec index acfdefc..319a1b2 100644 --- a/Data_Eval/Data_Eval/Data_Eval.nuspec +++ b/Data_Eval/Data_Eval/Data_Eval.nuspec @@ -2,7 +2,7 @@ Data.Eval - 2.4.3 + 2.4.4 Data.Eval Bruce Dunwiddie shriop