Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
"isRoot": true,
"tools": {
"paket": {
"version": "8.0.0",
"version": "9.0.2",
"commands": [
"paket"
]
],
"rollForward": false
},
"fantomas": {
"version": "6.2.3",
"version": "7.0.1",
"commands": [
"fantomas"
]
],
"rollForward": false
}
}
}
1,002 changes: 505 additions & 497 deletions .paket/Paket.Restore.targets

Large diffs are not rendered by default.

63 changes: 40 additions & 23 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,47 @@ RESTRICTION: || (== net6.0) (== net7.0) (== net8.0) (== netstandard2.0) (== nets
NUGET
remote: https://api.nuget.org/v3/index.json
FSharp.Core (6.0.7)
FsUnit (5.6)
FsUnit (7.0.1)
FSharp.Core (>= 5.0.2)
NUnit (>= 3.14)
Microsoft.CodeCoverage (17.8) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= net462)) (&& (== netstandard2.1) (>= netcoreapp3.1))
Microsoft.NET.Test.Sdk (17.8)
Microsoft.CodeCoverage (>= 17.8) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= net462)) (&& (== netstandard2.1) (>= netcoreapp3.1))
Microsoft.TestPlatform.TestHost (>= 17.8) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1))
Microsoft.NETCore.Platforms (7.0.4)
Microsoft.TestPlatform.ObjectModel (17.8) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1))
NuGet.Frameworks (>= 6.5)
NUnit (>= 4.0.1)
Microsoft.ApplicationInsights (2.23) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= net462)) (&& (== netstandard2.1) (>= netcoreapp3.1))
System.Diagnostics.DiagnosticSource (>= 5.0)
Microsoft.CodeCoverage (17.13) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= net462)) (&& (== netstandard2.1) (>= netcoreapp3.1))
Microsoft.NET.Test.Sdk (17.13)
Microsoft.CodeCoverage (>= 17.13) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= net462)) (&& (== netstandard2.1) (>= netcoreapp3.1))
Microsoft.TestPlatform.TestHost (>= 17.13) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1))
Microsoft.Testing.Extensions.Telemetry (1.6.3) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= net462)) (&& (== netstandard2.1) (>= netcoreapp3.1))
Microsoft.ApplicationInsights (>= 2.22)
Microsoft.Testing.Platform (>= 1.6.3)
Microsoft.Testing.Extensions.TrxReport.Abstractions (1.6.3) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= net462)) (&& (== netstandard2.1) (>= netcoreapp3.1))
Microsoft.Testing.Platform (>= 1.6.3)
Microsoft.Testing.Extensions.VSTestBridge (1.6.3) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= net462)) (&& (== netstandard2.1) (>= netcoreapp3.1))
Microsoft.Testing.Extensions.Telemetry (>= 1.6.3)
Microsoft.Testing.Extensions.TrxReport.Abstractions (>= 1.6.3)
Microsoft.Testing.Platform (>= 1.6.3)
Microsoft.TestPlatform.ObjectModel (>= 17.13)
Microsoft.Testing.Platform (1.6.3) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= net462)) (&& (== netstandard2.1) (>= netcoreapp3.1))
Microsoft.Testing.Platform.MSBuild (1.6.3) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= net462)) (&& (== netstandard2.1) (>= netcoreapp3.1))
Microsoft.Testing.Platform (>= 1.6.3)
Microsoft.TestPlatform.ObjectModel (17.13) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1))
System.Reflection.Metadata (>= 1.6)
Microsoft.TestPlatform.TestHost (17.8) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1))
Microsoft.TestPlatform.ObjectModel (>= 17.8) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1))
Microsoft.TestPlatform.TestHost (17.13) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1))
Microsoft.TestPlatform.ObjectModel (>= 17.13) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1))
Newtonsoft.Json (>= 13.0.1) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1))
NETStandard.Library (2.0.3)
Microsoft.NETCore.Platforms (>= 1.1)
Newtonsoft.Json (13.0.3) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1))
NuGet.Frameworks (6.7) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1))
NUnit (3.14)
NETStandard.Library (>= 2.0)
NUnit.Analyzers (3.9)
NUnit3TestAdapter (4.5)
System.Collections.Immutable (8.0) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1))
System.Runtime.CompilerServices.Unsafe (>= 6.0) - restriction: || (== net6.0) (&& (== net7.0) (>= net462)) (&& (== net7.0) (< net6.0)) (&& (== net8.0) (>= net462)) (&& (== net8.0) (< net6.0)) (&& (== net8.0) (< net7.0)) (== netstandard2.0) (== netstandard2.1)
System.Reflection.Metadata (8.0) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1))
System.Collections.Immutable (>= 8.0)
System.Runtime.CompilerServices.Unsafe (6.0) - restriction: || (== net6.0) (&& (== net7.0) (== netstandard2.0)) (&& (== net7.0) (== netstandard2.1)) (&& (== net7.0) (>= net462)) (&& (== net7.0) (< net6.0)) (&& (== net8.0) (== netstandard2.0)) (&& (== net8.0) (== netstandard2.1)) (&& (== net8.0) (>= net462)) (&& (== net8.0) (< net6.0)) (&& (== net8.0) (< net7.0)) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= net6.0)) (&& (== netstandard2.1) (>= netcoreapp3.1))
NUnit (4.3.2)
NUnit.Analyzers (4.7)
NUnit3TestAdapter (5.0)
Microsoft.Testing.Extensions.VSTestBridge (>= 1.5.3) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= net462)) (&& (== netstandard2.1) (>= netcoreapp3.1))
Microsoft.Testing.Platform.MSBuild (>= 1.5.3) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= net462)) (&& (== netstandard2.1) (>= netcoreapp3.1))
System.Collections.Immutable (9.0.3) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1))
System.Memory (>= 4.5.5) - restriction: || (== net6.0) (== net7.0) (&& (== net8.0) (>= net462)) (== netstandard2.0) (== netstandard2.1)
System.Runtime.CompilerServices.Unsafe (>= 6.0) - restriction: || (== net6.0) (== net7.0) (&& (== net8.0) (>= net462)) (== netstandard2.0) (== netstandard2.1)
System.Diagnostics.DiagnosticSource (9.0.3) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= net462)) (&& (== netstandard2.1) (>= netcoreapp3.1))
System.Memory (>= 4.5.5) - restriction: || (== net6.0) (== net7.0) (&& (== net8.0) (>= net462)) (== netstandard2.0) (== netstandard2.1)
System.Runtime.CompilerServices.Unsafe (>= 6.0) - restriction: || (== net6.0) (== net7.0) (&& (== net8.0) (>= net462)) (== netstandard2.0) (== netstandard2.1)
System.Memory (4.6.3) - restriction: || (== net6.0) (== net7.0) (&& (== net8.0) (== netstandard2.0)) (&& (== net8.0) (== netstandard2.1)) (&& (== net8.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1))
System.Reflection.Metadata (9.0.3) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1))
System.Collections.Immutable (>= 9.0.3)
System.Memory (>= 4.5.5) - restriction: || (== net6.0) (== net7.0) (&& (== net8.0) (>= net462)) (== netstandard2.0) (== netstandard2.1)
System.Runtime.CompilerServices.Unsafe (6.1.2) - restriction: || (== net6.0) (== net7.0) (&& (== net8.0) (== netstandard2.0)) (&& (== net8.0) (== netstandard2.1)) (&& (== net8.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1))
7 changes: 2 additions & 5 deletions src/Fli.Tests/ExecContext/ExecCommandConfigureUnixTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ open System.Text
[<Test>]
[<Platform("Linux,Unix,MacOsX")>]
let ``Check FileName in ProcessStartInfo Exec program`` () =
cli { Exec "bash" }
|> Command.buildProcess
|> _.FileName
|> should equal "bash"
cli { Exec "bash" } |> Command.buildProcess |> _.FileName |> should equal "bash"

[<Test>]
[<Platform("Linux,Unix,MacOsX")>]
Expand Down Expand Up @@ -120,4 +117,4 @@ let ``Check all possible values in ProcessStartInfo`` () =
config.Environment.Contains(KeyValuePair("Fli", "test")) |> should be True
config.Environment.Contains(KeyValuePair("Fli.Test", "test")) |> should be True
config.StandardOutputEncoding |> should equal Encoding.UTF8
config.StandardErrorEncoding |> should equal Encoding.UTF8
config.StandardErrorEncoding |> should equal Encoding.UTF8
21 changes: 20 additions & 1 deletion src/Fli.Tests/ExecContext/ExecCommandConfigureWindowsTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@ let ``Check Arguments in ProcessStartInfo with Arguments`` () =
|> _.Arguments
|> should equal "-c echo Hello World!"

#if NET
[<Test>]
[<Platform("Win")>]
let ``Check Arguments in ProcessStartInfo with ArgumentList`` () =
cli {
Exec "cmd.exe"
Arguments [ "-c"; "echo Hello World!" ]
}
|> Command.buildProcess
|> _.ArgumentList
:> seq<_>
|> should
equal
(seq {
"-c"
"echo Hello World!"
})
#endif

[<Test>]
[<Platform("Win")>]
let ``Check WorkingDirectory in ProcessStartInfo with WorkingDirectory`` () =
Expand Down Expand Up @@ -153,4 +172,4 @@ let ``Check all possible values in ProcessStartInfo for windows`` () =
config.Environment.Contains(KeyValuePair("Fli.Test", "test")) |> should be True
config.StandardOutputEncoding |> should equal Encoding.UTF8
config.StandardErrorEncoding |> should equal Encoding.UTF8
config.WindowStyle |> should equal Diagnostics.ProcessWindowStyle.Normal
config.WindowStyle |> should equal Diagnostics.ProcessWindowStyle.Normal
2 changes: 1 addition & 1 deletion src/Fli.Tests/ExecContext/ExecCommandExecuteUnixTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ let ``Passing data to a progrma on stdin`` () =
}
|> Command.execute
|> Output.toText
|> should equal "Test"
|> should equal "Test"
13 changes: 12 additions & 1 deletion src/Fli.Tests/ExecContext/ExecCommandExecuteWindowsTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ let ``Hello World with executing program`` () =
|> Output.toText
|> should equal "Hello World!"

[<Test>]
[<Platform("Win")>]
let ``Print "Test" properly with ArgumentList`` () =
cli {
Exec "pwsh.exe"
Arguments [ "/C"; "Write-Host \"Test\"" ]
}
|> Command.execute
|> Output.toText
|> should equal "Test"

[<Test>]
[<Platform("Win")>]
let ``Get process Id`` () =
Expand Down Expand Up @@ -110,4 +121,4 @@ let ``Hello World with executing program throws exception with unknown Verb`` ()
|> ignore
with :? ArgumentException as ex ->
ex.Message
|> should equal ("Unknown verb 'print'. Possible verbs on 'cmd.exe': open, runas, runasuser")
|> should equal ("Unknown verb 'print'. Possible verbs on 'cmd.exe': open, runas, runasuser")
15 changes: 9 additions & 6 deletions src/Fli.Tests/ExecContext/ExecConfigTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let ``Check arguments config for executing program`` () =
Arguments "echo Hello World!"
}
|> _.config.Arguments
|> should equal (Some "echo Hello World!")
|> should equal (Some(Arguments(Some "echo Hello World!")))

[<Test>]
let ``Check arguments list config for executing program`` () =
Expand All @@ -25,7 +25,7 @@ let ``Check arguments list config for executing program`` () =
Arguments [ "echo"; "Hello World!" ]
}
|> _.config.Arguments
|> should equal (Some "echo Hello World!")
|> should equal (Some(ArgumentList(Some [| "echo"; "Hello World!" |])))

[<Test>]
let ``Check Input config for executing program`` () =
Expand All @@ -51,15 +51,17 @@ let ``Empty string in Output ends up as None`` () =
Exec "cmd.exe"
Output ""
}
|> _.config.Output |> should be (ofCase <@ None @>)
|> _.config.Output
|> should be (ofCase <@ None @>)

[<Test>]
let ``Nullable file path in Output ends up as None`` () =
cli {
Exec "cmd.exe"
Output (File(null))
Output(File(null))
}
|> _.config.Output |> should be (ofCase <@ None @>)
|> _.config.Output
|> should be (ofCase <@ None @>)

[<Test>]
let ``Check working directory config for executing program`` () =
Expand All @@ -74,7 +76,8 @@ let ``Check working directory config for executing program`` () =
let ``Check WindowStyle config for executing program`` () =
cli {
Exec "cmd.exe"
WindowStyle Normal }
WindowStyle Normal
}
|> _.config.WindowStyle
|> should equal (Some Normal)

Expand Down
5 changes: 1 addition & 4 deletions src/Fli.Tests/ShellContext/ShellCommandConfigureUnixTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ open System.Text
[<Test>]
[<Platform("Linux,Unix,MacOsX")>]
let ``Check FileName in ProcessStartInfo with CMD Shell`` () =
cli { Shell BASH }
|> Command.buildProcess
|> _.FileName
|> should equal "bash"
cli { Shell BASH } |> Command.buildProcess |> _.FileName |> should equal "bash"

[<Test>]
[<Platform("Linux,Unix,MacOsX")>]
Expand Down
8 changes: 5 additions & 3 deletions src/Fli.Tests/ShellContext/ShellConfigTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,17 @@ let ``Empty string in Output ends up as None`` () =
Shell CMD
Output ""
}
|> _.config.Output |> should be (ofCase <@ None @>)
|> _.config.Output
|> should be (ofCase <@ None @>)

[<Test>]
let ``Nullable file path in Output ends up as None`` () =
cli {
Shell CMD
Output (File(null))
Output(File(null))
}
|> _.config.Output |> should be (ofCase <@ None @>)
|> _.config.Output
|> should be (ofCase <@ None @>)

[<Test>]
let ``Check WorkingDirectory config`` () =
Expand Down
10 changes: 4 additions & 6 deletions src/Fli/CE.fs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ module CE =

/// Extra `Output` that is being executed immediately after getting output from execution.
[<CustomOperation("Output")>]
member _.Output(context: ICommandContext<ShellContext>, output: Outputs) =
Cli.output output context.Context
member _.Output(context: ICommandContext<ShellContext>, output: Outputs) = Cli.output output context.Context

/// Extra `Output` that is being executed immediately after getting output from execution.
[<CustomOperation("Output")>]
Expand Down Expand Up @@ -99,8 +98,8 @@ module CE =
member _.Arguments(context: ICommandContext<ExecContext>, arguments) =
let matchArguments arguments =
match box arguments with
| :? string as s -> s
| :? seq<string> as s -> s |> Seq.map string |> String.concat " "
| :? string as s -> s |> Some |> Arguments
| :? seq<string> as s -> s |> Array.ofSeq |> Some |> ArgumentList
| _ -> failwith "Cannot convert arguments to a string!"

Program.arguments (matchArguments arguments) context.Context
Expand All @@ -111,8 +110,7 @@ module CE =

/// Extra `Output` that is being executed immediately after getting output from execution.
[<CustomOperation("Output")>]
member _.Output(context: ICommandContext<ExecContext>, output: Outputs) =
Program.output output context.Context
member _.Output(context: ICommandContext<ExecContext>, output: Outputs) = Program.output output context.Context

/// Extra `Output` that is being executed immediately after getting output from execution.
[<CustomOperation("Output")>]
Expand Down
Loading