Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DedSec256 committed Dec 17, 2024
1 parent e68f276 commit 48ad561
Show file tree
Hide file tree
Showing 25 changed files with 107 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Module

let (|Bool|) (x: int) = true

let f (x{caret} & Bool(_)) = ()
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Module

let (|Bool|) (x: int) = true

let f (x: int{caret} & Bool(_)) = ()
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Module

let f (x, y as z{caret}) = ()
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Module

let f (x, y as (z: 'a * 'b){caret}) = ()
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Module

fun x{caret} -> x + 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Module

fun (x: int){caret} -> x + 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Module

let f x{caret} = x + 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Module

let f (x: int){caret} = x + 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Module

type A =
member _.M1(?x{caret}) = x.Value + 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Module

type A =
member _.M1(?x: int{caret}) = x.Value + 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Module

type R = { A: int }

let f { A = a{caret} } = ()
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Module

type R = { A: int }

let f { A = (a: int){caret} } = ()
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Module

let f (a{caret}, b) = a + b
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Module

let f (a: int{caret}, b) = a + b
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Module

let a, b{caret} = 1, 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Module

let a, (b: int){caret} = 1, 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Module

let f (x{caret}, y as z) = ()
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Module

let f (x: 'a{caret}, y as z) = ()
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Module

let f (Some(x{caret})) = x + 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Module

let f (Some(x: int{caret})) = x + 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Module

let f (Some(Value = x{caret})) = x + 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Module

let f (Some(Value = (x: int){caret})) = x + 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Module

let f (Some x{caret}) = x + 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Module

let f (Some(x: int){caret}) = x + 1
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,31 @@ type SpecifyFunctionTypesActionTest() =
[<Test>] member x.``Function - Recursive - Function 04`` () = x.DoNamedTest()


type SpecifyPatternTypeActionTest() =
inherit FSharpContextActionExecuteTestBase<PatternAnnotationAction>()

override x.ExtraPath = "specifyTypes/patterns"

[<Test>] member x.``Parameter 01``() = x.DoNamedTest()
[<Test>] member x.``Parameter 02 - Optional``() = x.DoNamedTest()

[<Test>] member x.``Lambda 01``() = x.DoNamedTest()

[<Test>] member x.``Tuple 01``() = x.DoNamedTest()
[<Test>] member x.``Tuple 02 - Top level``() = x.DoNamedTest()
[<Test>] member x.``Tuple 03 - As``() = x.DoNamedTest()

[<Test>] member x.``Record field 01``() = x.DoNamedTest()

[<Test>] member x.``Union case 01``() = x.DoNamedTest()
[<Test>] member x.``Union case 02 - Named``() = x.DoNamedTest()
[<Test>] member x.``Union case 03 - Parens``() = x.DoNamedTest()

[<Test>] member x.``As pat 01``() = x.DoNamedTest()

[<Test>] member x.``Ands pat 01``() = x.DoNamedTest()


type SpecifyTypesActionAvailabilityTest() =
inherit FSharpContextActionAvailabilityTestBase<FunctionAnnotationAction>()

Expand Down

0 comments on commit 48ad561

Please sign in to comment.