@@ -69,23 +69,33 @@ public EvalTests(ITestOutputHelper outputHelper)
6969 [ InlineData ( @"var a = ""thing""; return a;" , "thing" , "string" ) ]
7070 [ InlineData ( "Math.Pow(1,2)" , 1D , "double" ) ]
7171 [ InlineData ( @"Enumerable.Range(0,1).Select(a=>""@"");" , null , null ) ]
72- [ InlineData ( "typeof(int)" , "System.Int32, System.Private.CoreLib, Version=7 .0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" , "RuntimeType" ) ]
72+ [ InlineData ( "typeof(int)" , "System.Int32, System.Private.CoreLib, Version=8 .0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" , "RuntimeType" ) ]
7373 [ InlineData ( "Assembly.GetExecutingAssembly()" , true , "RuntimeAssembly" ) ]
7474 [ InlineData ( "TimeSpan.FromSeconds(2310293892)" , "26739.12:18:12" , "TimeSpan" ) ]
7575 [ InlineData ( "float.PositiveInfinity" , "Infinity" , "float" ) ]
76+ [ InlineData ( "List<int> l = [1, 2, 3]; l" , "[1,2,3]" , "List<int>" ) ]
7677 public async Task Eval_WellFormattedCodeExecutes ( string expr , object expected , string type )
7778 {
7879 var ( result , statusCode ) = await Execute ( expr ) ;
7980 var res = result . ReturnValue as JsonElement ? ;
8081 object convertedValue ;
81- if ( expected is string || expected is null )
82+ if ( res . Value . ValueKind == JsonValueKind . Array )
83+ {
84+ convertedValue = res . Value . GetRawText ( ) ;
85+ }
86+ else if ( expected is string || expected is null )
8287 {
8388 convertedValue = res ? . GetString ( ) ;
8489 }
8590 else if ( res . Value . ValueKind == JsonValueKind . Object )
8691 {
8792 convertedValue = res . HasValue ;
8893 }
94+ else if ( result . ReturnTypeName == "RuntimeAssembly" )
95+ {
96+ // nothing to do here, value is random for this test
97+ convertedValue = expected ;
98+ }
8999 else
90100 {
91101 var value = res . Value . GetRawText ( ) ;
@@ -186,8 +196,8 @@ public async Task Eval_ConsoleOutputIsCaptured(string expr, string consoleOut, o
186196 [ Fact ]
187197 public async Task Eval_LoadDLLThatExposesTypeOfADependency ( )
188198 {
189- var expr = "#nuget CK.ActivityMonitor\n var m = new ActivityMonitor();" ;
190- var ( _ , statusCode ) = await Execute ( expr ) ;
199+ var expr = "#nuget CK.ActivityMonitor\n var m = new CK.Core. ActivityMonitor();" ;
200+ var ( result , statusCode ) = await Execute ( expr ) ;
191201
192202 Assert . Equal ( HttpStatusCode . OK , statusCode ) ;
193203 }
0 commit comments