Skip to content

Commit

Permalink
Add regression test for #1422 (#1466)
Browse files Browse the repository at this point in the history
  • Loading branch information
Theodor Thornhill authored Feb 21, 2021
1 parent 21c4ca0 commit cf21812
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/Fantomas.Tests/DotGetTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -890,3 +890,43 @@ let blah =
{ dasdasdsadsadsadsa = ""
Sdadsadasdasdas = "sdsadsadasdsa" })
"""

[<Test>]
let ``avoid name-sensitive alignments, 1422`` () =
formatSourceString
false
"""
let retrySql<'a> =
Policy
.HandleTransientSqlError()
.WaitAndRetryAsync(
List.map TimeSpan.FromSeconds [ 1.; 2.; 3. ],
fun ex ts i ctx ->
Log.Information(
ex,
"DB retry policy: Exception thrown, performing retry {RetryNo}, operation {OperationKey}",
i,
ctx.OperationKey
))
.AsAsyncPolicy<'a>()
"""
config
|> prepend newline
|> should
equal
"""
let retrySql<'a> =
Policy
.HandleTransientSqlError()
.WaitAndRetryAsync(
List.map TimeSpan.FromSeconds [ 1.; 2.; 3. ],
fun ex ts i ctx ->
Log.Information(
ex,
"DB retry policy: Exception thrown, performing retry {RetryNo}, operation {OperationKey}",
i,
ctx.OperationKey
)
)
.AsAsyncPolicy<'a>()
"""

0 comments on commit cf21812

Please sign in to comment.