-
-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove Fsi, Stdin and Stdout. * Update the meaning of --force. * Don't processFolder asynchronously. * Mention invalid result when force is active. Don't print exception stacktrace. * Add test to cover --force functionality. * Update documentation. * Add changelog entry.
- Loading branch information
Showing
9 changed files
with
112 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
module Fantomas.Tests.Integration.ForceTests | ||
|
||
open System.IO | ||
open NUnit.Framework | ||
open FsUnit | ||
open Fantomas.Tests.TestHelpers | ||
|
||
// The day this test fails because Fantomas can format the file, is the day you can remove this file. | ||
|
||
[<Test>] | ||
let ``code that was invalid should be still be written`` () = | ||
let pwd = Path.GetDirectoryName(typeof<TemporaryFileCodeSample>.Assembly.Location) | ||
|
||
let sourceFile = | ||
Path.Combine( | ||
pwd, | ||
"..", | ||
"..", | ||
"..", | ||
"..", | ||
"..", | ||
"paket-files", | ||
"dotnet", | ||
"fsharp", | ||
"src", | ||
"Compiler", | ||
"Checking", | ||
"CheckDeclarations.fs" | ||
) | ||
|
||
use outputFixture = new OutputFile() | ||
|
||
let { ExitCode = exitCode; Output = output } = | ||
runFantomasTool $"--force --out {outputFixture.Filename} {sourceFile}" | ||
|
||
exitCode |> should equal 0 | ||
|
||
output | ||
|> should contain "was not valid after formatting" | ||
|
||
output |> should contain "has been written" | ||
|
||
File.Exists outputFixture.Filename | ||
|> should equal true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.