Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8dd11c0

Browse files
committed
clean up tests
1 parenteb3bb2e commit8dd11c0

File tree

1 file changed

+64
-64
lines changed

1 file changed

+64
-64
lines changed

‎tests/fsharp/core/quotes/test.fsx‎

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2575,70 +2575,70 @@ module TestsForUsingReflectedDefinitionArgumentsAsFirstClassValues =
25752575
static memberPlotLinqOverloadedByShape(x:Func<int,'T>)= x.ToString()
25762576
static memberPlotLinqOverloadedByShape(x:Expression<Func<int,'T>>)= x.ToString()
25772577

2578-
//open Microsoft.FSharp.Quotations
2579-
//letf (x:Expr<'T>) =x.ToString()
2580-
2581-
(FirstClassTests.PlotLinq: Expression<Func<int,int>>-> string)// doesn't quote implicit var
2582-
(FirstClassTests.PlotLinq:(int-> int)-> string)// doesn't quote implicit var
2583-
2584-
letcallLinqWithoutAutoConv(ef:Expression<Func<int,int>>)= FirstClassTests.PlotLinq ef
2585-
letcallLinqWithAutoConv(f:int->int)= FirstClassTests.PlotLinq(fun x-> f x)// needs eta-expansion
2586-
2587-
letcallLinqOverloadedByTypeWithoutAutoConvInt(ef:Expression<Func<int,int>>)= FirstClassTests.PlotLinqOverloadedByTypeef
2588-
letcallLinqOverloadedByTypeWithoutAutoConvString(ef:Expression<Func<string,int>>)= FirstClassTests.PlotLinqOverloadedByType ef
2589-
letcallLinqOverloadedByTypeWithAutoConvInt(f:int->int)= FirstClassTests.PlotLinqOverloadedByType(fun x-> f x)
2590-
letcallLinqOverloadedByTypeWithAutoConvString(f:string->int)= FirstClassTests.PlotLinqOverloadedByType(fun x-> f x)
2591-
2592-
letcallLinqOverloadedByShapeWithoutAutoConv(ef:Expression<Func<int,int>>)= FirstClassTests.PlotLinqOverloadedByShape ef
2593-
// EXPECTED AND CONSISTENT: letcallLinqOverloadedByShapeWithAutoConv (f: int -> int) =C.PlotLinqOverloadedByShape (fun x -> f x)
2594-
2595-
letcallExprWithoutAutoConv(ef:Expr<int>)= FirstClassTests.PlotExpr<@%ef@>
2596-
letcallExprWithAutoConv(ef:int)=FirstClassTests.PlotExpr ef
2597-
2598-
letcallExprOverloadedWithoutAutoConvA(ef:Expr<int>)= FirstClassTests.PlotExprOverloadedByType<@%ef@>
2599-
letcallExprOverloadedWithoutAutoConvB(ef:Expr<int>)= FirstClassTests.PlotExprOverloadedByType ef
2600-
letcallExprOverloadedWithAutoConv(ef:int)= FirstClassTests.PlotExprOverloadedByType ef
2601-
2602-
letcallExprOverloadedByShapeWithoutAutoConvA(ef:Expr<int>)= FirstClassTests.PlotExprOverloadedByShape<@%ef@>
2603-
letcallExprOverloadedByShapeWithoutAutoConvB(ef:Expr<int>)= FirstClassTests.PlotExprOverloadedByShape ef
2604-
// EXPECTED AND CONSISTENT: letcallExprOverloadedByShapeWithAutoConv (ef:int) = C.PlotExprOverloadedByShape ef
2605-
2606-
(FirstClassTests.PlotLinq:(int-> int)-> string)// auto- - though not very useful
2607-
(FirstClassTests.PlotLinq:Expression<Func<int,int>>-> string)// doesn't auto-quote implicit var
2608-
(FirstClassTests.PlotLinqOverloadedByType:(int->int)-> string)// auto- - though not very useful
2609-
(FirstClassTests.PlotLinqOverloadedByType:(int-> string)-> string)// auto- - though not very useful
2610-
(FirstClassTests.PlotLinqOverloadedByType:Expression<Func<int,int>>-> string)//doesn'tauto-quote implicit var
2611-
(FirstClassTests.PlotLinqOverloadedByShape:Expression<Func<int,int>>-> string)//doesn'tauto-quote implicit var
2612-
// EXPECTED AND CONSISTENT: (C.PlotLinqOverloadedByShape :(int -> int)-> string)// auto- - though not very useful
2613-
2614-
(FirstClassTests.PlotExpr:Expr<int>-> string)//doesn't auto-quote implicit var
2615-
(FirstClassTests.PlotExpr: int-> string)// does auto-quote implicit var
2616-
(FirstClassTests.PlotExprOverloadedByType: Expr<int>-> string)// doesn't auto-quote implicit var
2617-
(FirstClassTests.PlotExprOverloadedByType: int-> string)//does auto-quote implicit var
2618-
(FirstClassTests.PlotExprOverloadedByType: string-> string)// does auto-quote implicit var
2619-
(FirstClassTests.PlotExprOverloadedByShape: Expr<int>-> string)// doesn't auto-quote implicit var
2620-
// EXPECTED AND CONSISTENT: (C.PlotExprOverloadedByShape : int -> string) // does auto-quote implicit var
2621-
2622-
2623-
FirstClassTests.PlotExpr1
2624-
FirstClassTests.PlotExpr<@1@>
2625-
FirstClassTests.PlotExprOverloadedByType1
2626-
FirstClassTests.PlotExprOverloadedByType<@1@>
2627-
FirstClassTests.PlotExprOverloadedByType"a"
2628-
FirstClassTests.PlotExprOverloadedByType<@"a"@>
2629-
//EXPECTED AND CONSISTENT: 1 |> FirstClassTests.PlotExprOverloadedByShape
2630-
FirstClassTests.PlotExprOverloadedByShape<@1@>
2631-
2632-
2633-
1|> FirstClassTests.PlotExpr
2634-
<@1@>|> FirstClassTests.PlotExpr
2635-
1|> FirstClassTests.PlotExprOverloadedByType
2636-
<@1@>|> FirstClassTests.PlotExprOverloadedByType
2637-
"a"|> FirstClassTests.PlotExprOverloadedByType
2638-
<@"a"@>|> FirstClassTests.PlotExprOverloadedByType
2639-
// EXPECTED AND CONSISTENT: 1 |> FirstClassTests.PlotExprOverloadedByShape
2640-
<@1@>|> FirstClassTests.PlotExprOverloadedByShape
2641-
2578+
// Most of the following tests are just checking that overloads are resolved correctly
2579+
letrunAll()=
2580+
2581+
// Check we can define a function that calls the overloads
2582+
letcallLinqWithoutAutoConv(ef:Expression<Func<int,int>>)= FirstClassTests.PlotLinq ef
2583+
letcallLinqWithAutoConv(f:int->int)= FirstClassTests.PlotLinq(fun x-> f x)// needs eta-expansion
2584+
letcallLinqOverloadedByTypeWithoutAutoConvInt(ef:Expression<Func<int,int>>)= FirstClassTests.PlotLinqOverloadedByType ef
2585+
letcallLinqOverloadedByTypeWithoutAutoConvString(ef:Expression<Func<string,int>>)= FirstClassTests.PlotLinqOverloadedByType ef
2586+
letcallLinqOverloadedByTypeWithAutoConvInt(f:int->int)= FirstClassTests.PlotLinqOverloadedByType(fun x-> f x)
2587+
letcallLinqOverloadedByTypeWithAutoConvString(f:string->int)= FirstClassTests.PlotLinqOverloadedByType(fun x-> f x)
2588+
letcallLinqOverloadedByShapeWithoutAutoConv(ef:Expression<Func<int,int>>)= FirstClassTests.PlotLinqOverloadedByShape ef
2589+
letcallExprWithoutAutoConv(ef:Expr<int>)= FirstClassTests.PlotExpr<@%ef@>
2590+
letcallExprWithAutoConv(ef:int)= FirstClassTests.PlotExpr ef
2591+
letcallExprOverloadedWithoutAutoConvA(ef:Expr<int>)= FirstClassTests.PlotExprOverloadedByType<@%ef@>
2592+
letcallExprOverloadedWithoutAutoConvB(ef:Expr<int>)= FirstClassTests.PlotExprOverloadedByType ef
2593+
letcallExprOverloadedWithAutoConv(ef:int)=FirstClassTests.PlotExprOverloadedByType ef
2594+
letcallExprOverloadedByShapeWithoutAutoConvA(ef:Expr<int>)= FirstClassTests.PlotExprOverloadedByShape<@%ef@>
2595+
letcallExprOverloadedByShapeWithoutAutoConvB(ef:Expr<int>)= FirstClassTests.PlotExprOverloadedByShape ef
2596+
// EXPECTED OVERLOAD RESOLUTION FAILURE:letcallLinqOverloadedByShapeWithAutoConv (f: int -> int) =C.PlotLinqOverloadedByShape (fun x -> f x) // overload not resolved
2597+
// EXPECTED OVERLOAD RESOLUTION FAILURE: let callExprOverloadedByShapeWithAutoConv (ef: int) = C.PlotExprOverloadedByShape ef // overload not resolved
2598+
2599+
// Check type-checking for type-annotated first-class function values
2600+
let_unusedFirstClassFunctionValue=(FirstClassTests.PlotLinq:(int-> int)-> string)// auto-quotes implicit var - though not very useful
2601+
let_unusedFirstClassFunctionValue=(FirstClassTests.PlotLinq: Expression<Func<int,int>>-> string)
2602+
let_unusedFirstClassFunctionValue=(FirstClassTests.PlotLinqOverloadedByType:(int-> int)-> string)// auto-quotes implicit var - though not very useful
2603+
let_unusedFirstClassFunctionValue=(FirstClassTests.PlotLinqOverloadedByType:(int-> string)-> string)// auto-quotes implicit var - though not very useful
2604+
let_unusedFirstClassFunctionValue=(FirstClassTests.PlotLinqOverloadedByType: Expression<Func<int,int>>-> string)
2605+
let_unusedFirstClassFunctionValue=(FirstClassTests.PlotLinqOverloadedByShape: Expression<Func<int,int>>-> string)
2606+
let_unusedFirstClassFunctionValue=(FirstClassTests.PlotLinqOverloadedByShape:Func<int,int>-> string)// auto-quotes implicit var - though not very useful
2607+
let_unusedFirstClassFunctionValue=(FirstClassTests.PlotExpr:Expr<int>-> string)
2608+
let_unusedFirstClassFunctionValue=(FirstClassTests.PlotExpr: int->string)// auto-quotes implicit var - though not very useful
2609+
let_unusedFirstClassFunctionValue=(FirstClassTests.PlotExprOverloadedByType:Expr<int>-> string)
2610+
let_unusedFirstClassFunctionValue=(FirstClassTests.PlotExprOverloadedByType: int-> string)// auto-quotes implicit var - though not very useful
2611+
let_unusedFirstClassFunctionValue=(FirstClassTests.PlotExprOverloadedByType:string-> string)// auto-quotes implicit var - though not very useful
2612+
let_unusedFirstClassFunctionValue=(FirstClassTests.PlotExprOverloadedByShape:Expr<int>-> string)
2613+
// EXPECTED OVERLOAD RESOLUTION FAILURE: (C.PlotLinqOverloadedByShape : (int -> int) -> string) // overload not resolved
2614+
// EXPECTED OVERLOAD RESOLUTION FAILURE: (C.PlotExprOverloadedByShape : int -> string)//overload not resolved
2615+
2616+
2617+
//Check type-checking for applications
2618+
let_unusedResultValue= FirstClassTests.PlotExpr1
2619+
let_unusedResultValue= FirstClassTests.PlotExpr<@1@>
2620+
let_unusedResultValue= FirstClassTests.PlotExprOverloadedByType1
2621+
let_unusedResultValue= FirstClassTests.PlotExprOverloadedByType<@1@>
2622+
let_unusedResultValue= FirstClassTests.PlotExprOverloadedByType"a"
2623+
let_unusedResultValue=FirstClassTests.PlotExprOverloadedByType<@"a"@>
2624+
let_unusedResultValue=FirstClassTests.PlotExprOverloadedByShape<@1@>
2625+
// EXPECTED OVERLOAD RESOLUTION FAILURE: let _unusedResultValue =FirstClassTests.PlotLinqOverloadedByShape (fun x -> x)
2626+
// EXPECTED OVERLOAD RESOLUTION FAILURE: let _unusedResultValue =FirstClassTests.PlotExprOverloadedByShape 1 // overload not resolved
2627+
2628+
2629+
//Check type-checking for pipelining
2630+
let_unusedResultValue=1|> FirstClassTests.PlotExpr
2631+
let_unusedResultValue=<@1@>|> FirstClassTests.PlotExpr
2632+
let_unusedResultValue=1|> FirstClassTests.PlotExprOverloadedByType
2633+
let_unusedResultValue=<@1@>|> FirstClassTests.PlotExprOverloadedByType
2634+
let_unusedResultValue="a"|> FirstClassTests.PlotExprOverloadedByType
2635+
let_unusedResultValue=<@"a"@>|> FirstClassTests.PlotExprOverloadedByType
2636+
let_unusedResultValue=<@1@>|> FirstClassTests.PlotExprOverloadedByShape
2637+
// EXPECTED OVERLOAD RESOLUTION FAILURE: 1|> FirstClassTests.PlotExprOverloadedByShape // overload not resolved
2638+
2639+
()
2640+
2641+
runAll()
26422642

26432643

26442644
letaa=

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp