Skip to content

Commit

Permalink
Merge pull request #25 from bruce-dunwiddie/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
bruce-dunwiddie authored Apr 17, 2020
2 parents 5e7c50b + c01d147 commit eaf33e9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Data_Eval/Data_Eval/Data_Eval.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<SignAssembly>true</SignAssembly>
<DelaySign>false</DelaySign>
<AssemblyOriginatorKeyFile>Data_Eval.snk</AssemblyOriginatorKeyFile>
<Version>2.4.3</Version>
<Version>2.4.4</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand Down
2 changes: 1 addition & 1 deletion Data_Eval/Data_Eval/Data_Eval.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>Data.Eval</id>
<version>2.4.3</version>
<version>2.4.4</version>
<title>Data.Eval</title>
<authors>Bruce Dunwiddie</authors>
<owners>shriop</owners>
Expand Down
7 changes: 7 additions & 0 deletions Data_Eval/Data_Eval/Evaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
14 changes: 14 additions & 0 deletions Data_Eval/Tests/EvaluatorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,5 +181,19 @@ public void Evaluator_DynamicVariable()

Assert.AreEqual("something", evaluator.Eval<string>());
}

[Test]
public void Evaluator_NullVariableComparison()
{
var evaluator = new Evaluator(
"return test == null");

evaluator.SetVariable(
"test",
null,
typeof(string));

Assert.IsTrue(evaluator.Eval<bool>());
}
}
}

0 comments on commit eaf33e9

Please sign in to comment.