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

Commit987850b

Browse files
Vasily KirichenkoVasily Kirichenko
Vasily Kirichenko
authored and
Vasily Kirichenko
committed
fix tests
1 parent8cb7ec2 commit987850b

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

‎vsintegration/src/FSharp.Editor/Formatting/BraceMatchingService.fs‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespaceMicrosoft.VisualStudio.FSharp.Editor
44

5-
openSystem
65
openSystem.ComponentModel.Composition
76
openMicrosoft.CodeAnalysis.Editor
87
openMicrosoft.FSharp.Compiler.SourceCodeServices
@@ -14,7 +13,6 @@ type internal FSharpBraceMatchingService
1413
checkerProvider: FSharpCheckerProvider,
1514
projectInfoManager: FSharpProjectOptionsManager
1615
)=
17-
1816

1917
static letdefaultUserOpName="BraceMatching"
2018

‎vsintegration/tests/UnitTests/BraceMatchingServiceTests.fs‎

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -161,26 +161,23 @@ let main argv =
161161
0 // return an integer exit code"""
162162
this.VerifyBraceMatch(code,"(printfn",")endBrace")
163163

164-
[<TestCase("let a1 = [ 0 .. 100 ]",[|9;10;20;21|])>]
165-
[<TestCase("let a2 = [| 0 .. 100 |]",[|9;10;11;21;22;23|])>]
166-
[<TestCase("let a3 = <@ 0 @>",[|9;10;11;14;15;16|])>]
167-
[<TestCase("let a4 = <@@ 0 @@>",[|9;10;11;12;15;15;16;17|])>]
168-
[<TestCase("let a6 = ( () )",[|9;10;16;17|])>]
169-
[<TestCase("[<ReflectedDefinition>]\nlet a7 = 70",[|0;1;2;21;22;23|])>]
170-
[<TestCase("let a8 = seq { yield() }",[|13;14;23;24|])>]
171-
memberthis.BraceMatchingBothSides_Bug2092(fileContents:string,matchingPositions:int[])=
172-
// https://github.com/Microsoft/visualfsharp/issues/2092
164+
[<TestCase("let a1 = [ 0 .. 100 ]",[|9;20|])>]
165+
[<TestCase("let a2 = [| 0 .. 100 |]",[|9;10;22|])>]
166+
[<TestCase("let a3 = <@ 0 @>",[|9;10;15|])>]
167+
[<TestCase("let a4 = <@@ 0 @@>",[|9;10;11;15;16|])>]
168+
[<TestCase("let a6 = ( () )",[|9;16|])>]
169+
[<TestCase("[<ReflectedDefinition>]\nlet a7 = 70",[|0;1;22|])>]
170+
[<TestCase("let a8 = seq { yield() }",[|13;23|])>]
171+
memberthis.DoNotMatchOnInnerSide(fileContents:string,matchingPositions:int[])=
173172
letsourceText= SourceText.From(fileContents)
174-
175173
letparsingOptions,_= checker.GetParsingOptionsFromProjectOptions projectOptions
176-
matchingPositions
177-
|> Array.iter(fun position->
174+
175+
for positionin matchingPositionsdo
178176
match FSharpBraceMatchingService.GetBraceMatchingResult(checker, sourceText, fileName, parsingOptions, position,"UnitTest")|> Async.RunSynchronouslywith
179177
| Some_->()
180178
| None->
181179
match positionwith
182180
|0->""
183181
|_-> fileContents.[position-1]|> sprintf" (previous character '%c')"
184-
|> sprintf"Didn't find a matching brace at position '%d', character '%c'%s" position fileContents.[position]
182+
|> sprintf"Didn't find a matching brace at position '%d'%s" position
185183
|> Assert.Fail
186-
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp