11using System ;
22
3-
43#if LIGHT_EXPRESSION
54using static FastExpressionCompiler . LightExpression . Expression ;
65namespace FastExpressionCompiler . LightExpression . UnitTests
@@ -9,7 +8,6 @@ namespace FastExpressionCompiler.LightExpression.UnitTests
98namespace FastExpressionCompiler . UnitTests
109#endif
1110{
12-
1311 public class LoopTests : ITest
1412 {
1513 public int Run ( )
@@ -24,7 +22,6 @@ public int Run()
2422 return 7 ;
2523 }
2624
27-
2825 public void Loop_with_return ( )
2926 {
3027 var intVariable = Variable ( typeof ( int ) , "i" ) ;
@@ -40,14 +37,15 @@ public void Loop_with_return()
4037 Label ( returnLabel ) ) ;
4138
4239 var loopLambda = Lambda < Action > ( lambdaBody ) ;
40+ loopLambda . PrintCSharp ( ) ;
41+
4342 var loopFunc = loopLambda . CompileFast ( true ) ;
4443
4544 Asserts . IsNotNull ( loopFunc ) ;
4645
4746 loopFunc . Invoke ( ) ;
4847 }
4948
50-
5149 public void Loop_with_break ( )
5250 {
5351 var intVariable = Variable ( typeof ( int ) , "i" ) ;
@@ -62,13 +60,13 @@ public void Loop_with_break()
6260 breakLabel )
6361 ) ;
6462 var loopFunc = loopLambda . CompileFast ( true ) ;
63+ loopLambda . PrintCSharp ( ) ;
6564
6665 Asserts . IsNotNull ( loopFunc ) ;
6766
6867 loopFunc . Invoke ( ) ;
6968 }
7069
71-
7270 public void Loop_with_unused_break ( )
7371 {
7472 var intVariable = Variable ( typeof ( int ) , "i" ) ;
@@ -84,14 +82,14 @@ public void Loop_with_unused_break()
8482 var lambdaBody = Block ( new [ ] { intVariable } , loop , Label ( returnLabel ) ) ;
8583
8684 var loopLambda = Lambda < Action > ( lambdaBody ) ;
85+ loopLambda . PrintCSharp ( ) ;
8786 var loopFunc = loopLambda . CompileFast ( true ) ;
8887
8988 Asserts . IsNotNull ( loopFunc ) ;
9089
9190 loopFunc . Invoke ( ) ;
9291 }
9392
94-
9593 public void Loop_with_break_and_continue ( )
9694 {
9795 var intVariable1 = Variable ( typeof ( int ) , "i" ) ;
@@ -115,14 +113,14 @@ public void Loop_with_break_and_continue()
115113 var lambdaBody = Block ( new [ ] { intVariable1 , intVariable2 } , loopWithBreakAndContinue ) ;
116114
117115 var loopLambda = Lambda < Action > ( lambdaBody ) ;
116+ loopLambda . PrintCSharp ( ) ;
118117 var loopFunc = loopLambda . CompileFast ( true ) ;
119118
120119 Asserts . IsNotNull ( loopFunc ) ;
121120
122121 loopFunc . Invoke ( ) ;
123122 }
124123
125-
126124 public void Loop_with_unused_continue ( )
127125 {
128126 var intVariable = Variable ( typeof ( int ) , "i" ) ;
@@ -138,14 +136,14 @@ public void Loop_with_unused_continue()
138136 var lambdaBody = Block ( new [ ] { intVariable } , loop ) ;
139137
140138 var loopLambda = Lambda < Action > ( lambdaBody ) ;
139+ loopLambda . PrintCSharp ( ) ;
141140 var loopFunc = loopLambda . CompileFast ( true ) ;
142141
143142 Asserts . IsNotNull ( loopFunc ) ;
144143
145144 loopFunc . Invoke ( ) ;
146145 }
147146
148-
149147 public void Loop_with_unused_break_and_continue ( )
150148 {
151149 var intVariable = Variable ( typeof ( int ) , "i" ) ;
@@ -162,14 +160,14 @@ public void Loop_with_unused_break_and_continue()
162160 var lambdaBody = Block ( new [ ] { intVariable } , loop , Label ( returnLabel ) ) ;
163161
164162 var loopLambda = Lambda < Action > ( lambdaBody ) ;
163+ loopLambda . PrintCSharp ( ) ;
165164 var loopFunc = loopLambda . CompileFast ( true ) ;
166165
167166 Asserts . IsNotNull ( loopFunc ) ;
168167
169168 loopFunc . Invoke ( ) ;
170169 }
171170
172-
173171 public void Loop_with_return_value ( )
174172 {
175173 var intVariable = Variable ( typeof ( int ) , "i" ) ;
@@ -184,6 +182,7 @@ public void Loop_with_return_value()
184182 var lambdaBody = Block ( new [ ] { intVariable } , loop , Label ( returnLabel , Constant ( 3 ) ) ) ;
185183
186184 var loopLambda = Lambda < Func < int > > ( lambdaBody ) ;
185+ loopLambda . PrintCSharp ( ) ;
187186 var loopFunc = loopLambda . CompileFast ( true ) ;
188187
189188 Asserts . IsNotNull ( loopFunc ) ;
0 commit comments