@@ -8,8 +8,7 @@ open Fantomas.Tests.TestHelpers
88[<Literal>]
99let Source = " let foo = 47"
1010
11- [<Literal>]
12- let Verbosity = " --verbosity d"
11+ let Verbosity = [ " --verbosity" ; " d" ]
1312
1413[<Test>]
1514let ``ignore all fs files`` () =
@@ -21,8 +20,7 @@ let ``ignore all fs files`` () =
2120 use outputFixture = new OutputFile()
2221
2322 let { ExitCode = exitCode } =
24- sprintf " --out %s %s " outputFixture.Filename inputFixture.Filename
25- |> runFantomasTool
23+ [ " --out" ; outputFixture.Filename; inputFixture.Filename ] |> runFantomasTool
2624
2725 exitCode |> should equal 0
2826 File.Exists outputFixture.Filename |> should equal false
@@ -34,7 +32,7 @@ let ``ignore specific file`` () =
3432 use inputFixture = new TemporaryFileCodeSample( Source, fileName = fileName)
3533
3634 use ignoreFixture = new FantomasIgnoreFile( " A.fs" )
37- let args = sprintf " %s %s " Verbosity inputFixture.Filename
35+ let args = Verbosity @ [ inputFixture.Filename ]
3836 let { ExitCode = exitCode ; Output = output } = runFantomasTool args
3937 exitCode |> should equal 0
4038
@@ -53,7 +51,7 @@ let ``ignore specific file in subfolder`` () =
5351 use ignoreFixture = new FantomasIgnoreFile( sprintf " %s /%s /A.fs" sub1 sub2)
5452
5553 let { ExitCode = exitCode } =
56- runFantomasTool ( sprintf " --check .%c%s " Path.DirectorySeparatorChar sub1)
54+ runFantomasTool [ " --check" ; $ " .%c { Path.DirectorySeparatorChar} %s { sub1} " ]
5755
5856 exitCode |> should equal 0
5957
@@ -64,7 +62,7 @@ let ``don't ignore other files`` () =
6462 use inputFixture = new TemporaryFileCodeSample( Source, fileName = fileName)
6563
6664 use ignoreFixture = new FantomasIgnoreFile( " A.fs" )
67- let args = sprintf " %s %s " Verbosity inputFixture.Filename
65+ let args = Verbosity @ [ inputFixture.Filename ]
6866 let { ExitCode = exitCode ; Output = output } = runFantomasTool args
6967 exitCode |> should equal 0
7068
@@ -83,7 +81,7 @@ let ``ignore file in folder`` () =
8381 use ignoreFixture = new FantomasIgnoreFile( " A.fs" )
8482
8583 let { ExitCode = exitCode ; Output = output } =
86- runFantomasTool $ " %s { Verbosity} .%c {Path.DirectorySeparatorChar}%s {subFolder}"
84+ runFantomasTool ( Verbosity @ [ $ " .%c {Path.DirectorySeparatorChar}%s {subFolder}" ])
8785
8886 exitCode |> should equal 0
8987 File.ReadAllText inputFixture.Filename |> should equal Source
@@ -99,7 +97,7 @@ let ``ignore file while checking`` () =
9997 use ignoreFixture = new FantomasIgnoreFile( " A.fs" )
10098
10199 let { ExitCode = exitCode ; Output = output } =
102- sprintf " %s %s --check" Verbosity inputFixture.Filename |> runFantomasTool
100+ [ " --check" ; yield ! Verbosity; inputFixture.Filename ] |> runFantomasTool
103101
104102 exitCode |> should equal 0
105103
@@ -116,7 +114,7 @@ let ``ignore file in folder while checking`` () =
116114 use ignoreFixture = new FantomasIgnoreFile( " A.fs" )
117115
118116 let { ExitCode = exitCode } =
119- runFantomasTool ( sprintf " .%c%s --check" Path.DirectorySeparatorChar subFolder )
117+ runFantomasTool [ $ " .%c {Path.DirectorySeparatorChar} %s {subFolder} " ; " --check" ]
120118
121119 exitCode |> should equal 0
122120 File.ReadAllText inputFixture.Filename |> should equal Source
@@ -132,7 +130,7 @@ let ``honor ignore file when processing a folder`` () =
132130 use inputFixture = new FantomasIgnoreFile( " *.fsx" )
133131
134132 let { Output = output } =
135- runFantomasTool ( sprintf " %s .%c%s " Verbosity Path.DirectorySeparatorChar subFolder)
133+ runFantomasTool ( Verbosity @ [ $ " .%c { Path.DirectorySeparatorChar} %s { subFolder} " ] )
136134
137135 output |> should not' ( contain " ignored" )
138136 output |> should contain " A.fs was formatted"
0 commit comments