Skip to content

Commit 2aef28f

Browse files
authored
Version 1.3.2.0
* Tests for inline namespaces (some still fail) version unstable * Support for Inlinenamespaces OK + add OptionInlineNamespacesEvaluationActive + Refactoring * Version 1.3.2.0 * perf improvement for type resolution * Doc to wiki * Absolutes links on wiki (so it works from local and any branch)
1 parent 2981c03 commit 2aef28f

File tree

5 files changed

+101
-729
lines changed

5 files changed

+101
-729
lines changed

CodingSeb.ExpressionEvaluator.Tests/CodingSeb.ExpressionEvaluator.Tests.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@
118118
<ItemGroup>
119119
<None Include="Resources\Script0032.txt" />
120120
</ItemGroup>
121+
<ItemGroup>
122+
<Reference Include="System.Net" />
123+
</ItemGroup>
121124
<ItemGroup>
122125
<EmbeddedResource Update="Resources.resx">
123126
<Generator>PublicResXFileCodeGenerator</Generator>

CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,13 +476,15 @@ public void TypeTesting(string expression, Type type)
476476
#region default values
477477
[TestCase("default(int)", TestOf = typeof(int), ExpectedResult = 0, Category = "default values")]
478478
[TestCase("default(bool)", TestOf = typeof(bool), ExpectedResult = false, Category = "default values")]
479+
[TestCase("default(System.Boolean)", TestOf = typeof(bool), ExpectedResult = false, Category = "default values, Inline namespaces")]
479480
#endregion
480-
481+
481482
#region typeof keyword
482483
[TestCase("typeof(int)", ExpectedResult = typeof(int), Category = "typeof keyword")]
483484
[TestCase("typeof(float)", ExpectedResult = typeof(float), Category = "typeof keyword")]
484485
[TestCase("typeof(string)", ExpectedResult = typeof(string), Category = "typeof keyword")]
485486
[TestCase("typeof(Regex)", ExpectedResult = typeof(Regex), Category = "typeof keyword")]
487+
[TestCase("typeof(System.Text.RegularExpressions.Regex)", ExpectedResult = typeof(Regex), Category = "typeof keyword,inline namespace")]
486488
[TestCase("typeof(string) == \"Hello\".GetType()", ExpectedResult = true, Category = "typeof keyword")]
487489
[TestCase("typeof(int) == 12.GetType()", ExpectedResult = true, Category = "typeof keyword")]
488490
[TestCase("typeof(string) == 12.GetType()", ExpectedResult = false, Category = "typeof keyword")]
@@ -492,7 +494,7 @@ public void TypeTesting(string expression, Type type)
492494
[TestCase("new ClassForTest1().GetType()", ExpectedResult = typeof(ClassForTest1), Category = "Create instance with new Keyword")]
493495
[TestCase("new ClassForTest2(15).GetType()", ExpectedResult = typeof(ClassForTest2), Category = "Create instance with new Keyword")]
494496
[TestCase("new ClassForTest2(15).Value1", ExpectedResult = 15, Category = "Create instance with new Keyword")]
495-
[TestCase("new CodingSeb.ExpressionEvaluator.Tests.OtherNamespace.ClassInOtherNameSpace1().Value1", ExpectedResult = 26, Category = "Create instance with new Keyword")]
497+
[TestCase("new CodingSeb.ExpressionEvaluator.Tests.OtherNamespace.ClassInOtherNameSpace1().Value1", ExpectedResult = 26, Category = "Create instance with new Keyword,Inline namespace")]
496498
[TestCase("new Regex(@\"\\w*[n]\\w*\").Match(\"Which word contains the desired letter ?\").Value", ExpectedResult = "contains", Category = "Create instance with new Keyword")]
497499
#endregion
498500

@@ -859,11 +861,14 @@ public void TypeTesting(string expression, Type type)
859861

860862
#region Complex expressions
861863
[TestCase("Enumerable.Range(1,4).Cast().Sum(x =>(int)x)", ExpectedResult = 10, Category = "Complex expression,Static method,Instance method,Lambda function,Cast")]
864+
[TestCase("System.Linq.Enumerable.Range(1,4).Cast().Sum(x =>(int)x)", ExpectedResult = 10, Category = "Complex expression,Static method,Instance method,Lambda function,Cast")]
862865
[TestCase("List(1,2,3,4,5,6).ConvertAll(x => (float)x)[2].GetType()", ExpectedResult = typeof(float), Category = "Complex expression,Type Manage,Instance method,Lambda function,Cast,Indexing")]
863866
[TestCase("List(\"hello\", \"bye\").Select(x => x.ToUpper()).ToList().FluidAdd(\"test\").Count", ExpectedResult = 3, Category = "Complex expression,Fluid Functions")]
864867
[TestCase("List(\"hello\", \"bye\").Select(x => x.ToUpper()).ToList().FluidAdd(\"test\")[0]", ExpectedResult = "HELLO", Category = "Complex expression,Fluid Functions")]
865868
[TestCase("List(\"hello\", \"bye\").Select(x => x.ToUpper()).ToList().FluidAdd(\"test\")[1]", ExpectedResult = "BYE", Category = "Complex expression,Fluid Functions")]
866869
[TestCase("List(\"hello\", \"bye\").Select(x => x.ToUpper()).ToList().FluidAdd(\"test\")[2]", ExpectedResult = "test", Category = "Complex expression,Fluid Functions")]
870+
[TestCase("List(\"hello\", \"bye\").Select(x => x.ToUpper()).ToList().FluidAdd(\"test\")[2]", ExpectedResult = "test", Category = "Complex expression,Fluid Functions")]
871+
[TestCase("$\"https://www.google.ch/search?q={System.Net.WebUtility.UrlEncode(\"test of request with url encode() ?\")}\"", ExpectedResult = "https://www.google.ch/search?q=test+of+request+with+url+encode()+%3F", Category = "Complex expression,Inline namespace")]
867872
#endregion
868873

869874
#endregion

CodingSeb.ExpressionEvaluator/CodingSeb.ExpressionEvaluator.csproj

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<Product>CodingSeb.ExpressionEvaluator</Product>
66
<Description>A Simple Math and Pseudo C# Expression Evaluator in One C# File. And from version 1.2.0 can execute small C# like scripts</Description>
77
<Copyright>Copyright © Coding Seb 2017</Copyright>
8-
<Version>1.3.1.0</Version>
9-
<AssemblyVersion>1.3.1.0</AssemblyVersion>
10-
<FileVersion>1.3.1.0</FileVersion>
8+
<Version>1.3.2.0</Version>
9+
<AssemblyVersion>1.3.2.0</AssemblyVersion>
10+
<FileVersion>1.3.2.0</FileVersion>
1111
<OutputPath>bin\$(Configuration)\</OutputPath>
1212
<Authors>Coding Seb</Authors>
1313
<PackageId>CodingSeb.ExpressionEvaluator</PackageId>
@@ -18,9 +18,9 @@
1818
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1919
<PackageIconUrl>https://github.com/codingseb/ExpressionEvaluator/blob/master/Icon.png?raw=true</PackageIconUrl>
2020
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
21-
<PackageReleaseNotes>* Array initialisation with new type[] { x, y, ...} or new type[2]
22-
* Correction of multiple bugs with String interpolation, doublequote char and string escape
23-
* Icon in ReadMe</PackageReleaseNotes>
21+
<PackageReleaseNotes>* Support for inline namespaces (More flexible, but slower)
22+
* Option OptionInlineNamespacesEvaluationActive (To unactive inline namespaces)
23+
* Remove not necessary nugets dependencies</PackageReleaseNotes>
2424
</PropertyGroup>
2525
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2626
<DebugType>full</DebugType>
@@ -31,9 +31,5 @@
3131
<ItemGroup>
3232
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
3333
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" />
34-
<PackageReference Include="System.Net.Http" Version="4.3.4" />
35-
</ItemGroup>
36-
<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
37-
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
3834
</ItemGroup>
3935
</Project>

0 commit comments

Comments
 (0)