Skip to content

Commit

Permalink
expand expecto test detection
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAngryByrd committed Sep 17, 2023
1 parent 57af8fa commit 76c32f5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/FsAutoComplete.Core/TestAdapter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ let getExpectoTests (ast: ParsedInput) : TestAdapterEntry<range> list =
visitExpr entry expr2
| Case, SynExpr.ComputationExpr _
| Case, SynExpr.Lambda _
| Case, SynExpr.Paren(SynExpr.Lambda _, _, _, _) ->
| Case, SynExpr.Paren(expr=SynExpr.App(argExpr = SynExpr.ComputationExpr _))
| Case, SynExpr.Paren(expr = (SynExpr.Lambda _)) ->
ident <- ident + 1

let entry =
Expand Down
2 changes: 1 addition & 1 deletion test/FsAutoComplete.Tests.Lsp/DetectUnitTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ let tests state =
(async {
let! testNotification = getTestNotification "ExpectoTests" "Sample.fs"
Expect.hasLength testNotification.Tests 1 "Expected to have found 1 expecto test list"
Expect.hasLength testNotification.Tests.[0].Childs 13 "Expected to have found 13 expecto tests"
Expect.hasLength testNotification.Tests.[0].Childs 15 "Expected to have found 13 expecto tests"
}) ]
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ let tests =
Expect.equal 4 (2+2) "2+2"
}

testCaseAsync "async test case backpipe" <| async {
Expect.equal 4 (2+2) "2+2"
}

testCaseAsync "async test case paren"(async {
Expect.equal 4 (2+2) "2+2"
})

testTheory "odd numbers" [1; 3; 5] ( fun x ->
Expect.isTrue (x % 2 = 1) "should be odd" )

Expand Down

0 comments on commit 76c32f5

Please sign in to comment.