Skip to content

Commit b6eb59c

Browse files
committed
Test regression fixes
1 parent c1fd116 commit b6eb59c

File tree

6 files changed

+15
-9
lines changed

6 files changed

+15
-9
lines changed

Shared/FactoryMethodsFormatter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ private void WriteMethodCall(string name, IEnumerable args) {
5959
} else if (arg is { }) {
6060
if (
6161
(
62-
argType?.InheritsFromOrImplementsAny(NodeTypes) ?? false ||
62+
argType!.InheritsFromOrImplementsAny(NodeTypes) ||
6363
arg is MemberInfo ||
6464
arg is CallSiteBinder
6565
) && !(

Tests.DataGenerator/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Program {
1212
static void Main(string[] args) {
1313
Loader.Load();
1414

15-
var formatter = FactoryMethods;
15+
var formatter = TextualTree;
1616
var language = CSharp;
1717

1818
var lines = new List<string>();

Tests.DotNetCore/TestContainer.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,9 @@ public class TestContainer : IClassFixture<ExpectedDataFixture> {
5757
[Theory]
5858
[MemberData(nameof(TestObjectsData))]
5959
public void TestMethod(string formatter, string objectName, string category, object o) {
60-
if (formatter != "Factory methods") { return; }
61-
if (objectName != "CSCompiler.StaticMember") { return; }
62-
6360
var expected = fixture.expectedStrings[(formatter, objectName)];
6461
var (actual, paths) = GetToString(formatter, o);
62+
6563
// test that the string result is correct
6664
Assert.Equal(expected, actual);
6765

Tests.DotNetCore/expectedResults/textual tree-testdata.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,13 +1879,13 @@ Lambda (Func<string>)
18791879
· Arguments[0] - Constant (string) = ","
18801880
· Arguments[1] - NewArrayInit (string[])
18811881
· Expressions[0] - New (string)
1882-
· Arguments[0] - MemberAccess (char[]) $VB$Local_arr = new[] { }
1882+
· Arguments[0] - MemberAccess (char[]) $VB$Local_arr = new[] { 'a', 'b' }
18831883
· Expression - Constant (<closure>)
18841884
---- VBCompiler.StaticMethod2ArgumentsWithoutConversion
18851885
Lambda (Func<string>)
18861886
· Body - Call (string) stringJoin
18871887
· Arguments[0] - Constant (string) = ","
1888-
· Arguments[1] - MemberAccess (IEnumerable<char>) $VB$Local_arr = new[] { }
1888+
· Arguments[1] - MemberAccess (IEnumerable<char>) $VB$Local_arr = new[] { 'a', 'b' }
18891889
· Expression - Constant (<closure>)
18901890
---- VBCompiler.ExtensionMethod2Arguments
18911891
Lambda (Func<IOrderedEnumerable<string>>)
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
using System;
22
using ExpressionTreeTestObjects;
3+
using ExpressionTreeToString;
4+
using static System.Linq.Expressions.Expression;
35

46
namespace _expressionTestObjectsTest {
57
class Program {
68
static void Main(string[] args) {
7-
var lst = Objects.Get();
9+
//var lst = Objects.Get();
810

9-
Console.WriteLine("Hello World!");
11+
//Console.WriteLine("Hello World!");
12+
13+
var expr = Lambda(
14+
Constant(null, typeof(string))
15+
);
16+
Console.WriteLine(expr.ToString("Factory methods"));
1017
}
1118
}
1219
}

_expressionTestObjectsTest/_expressionTestObjectsTest.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<ItemGroup>
99
<ProjectReference Include="..\ExpressionTreeTestObjects.VB\TestObjects.VB.vbproj" />
1010
<ProjectReference Include="..\ExpressionTreeTestObjects\TestObjects.csproj" />
11+
<ProjectReference Include="..\Library\Library.csproj" />
1112
</ItemGroup>
1213

1314
</Project>

0 commit comments

Comments
 (0)