diff --git a/.gitignore b/.gitignore index b5d7fe6..1a1f5ad 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ ## ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore +coverlet + # User-specific files *.suo *.user @@ -117,6 +119,7 @@ _TeamCity* # Visual Studio code coverage results *.coverage +coverage.cobertura.xml *.coveragexml # NCrunch diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..49ec52e --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +test: + dotnet test +test_reports: + dotnet test --collect "XPlat Code Coverage" --results-directory /tmp/pentole_reports/ + mv /tmp/pentole_reports/*/coverage.cobertura.xml coverage.cobertura.xml + reportgenerator -targetdir:coverlet/reports -reporttypes:HtmlInline_AzurePipelines -repots:coverage.cobertura.xml diff --git a/src/pervasives.fs b/src/pervasives.fs new file mode 100644 index 0000000..30e0128 --- /dev/null +++ b/src/pervasives.fs @@ -0,0 +1,16 @@ +module Pentole.Pervasives + +/// +/// The identity function. +/// +/// +let identity = id + +/// +/// Pass the object to a function and return the object unchanged. +/// Useful in the middle of pipelines to see what values are being passed or log +/// +/// +let tee fun_ obj = + fun_ obj + obj diff --git a/src/src.fsproj b/src/src.fsproj index 946c45b..7f0e83b 100644 --- a/src/src.fsproj +++ b/src/src.fsproj @@ -6,6 +6,7 @@ + diff --git a/tests/path_tests.fs b/tests/path_tests.fs index 21b7a2c..7a5c83f 100644 --- a/tests/path_tests.fs +++ b/tests/path_tests.fs @@ -38,6 +38,7 @@ let resolve_test () = s |> Path.of_string |> Result.bind resolve + |> Result.get let p (n: string ) = Path.of_string n |> Result.get "/" |> test |> Assert.ok_is_equal (p "/") @@ -48,7 +49,7 @@ let resolve_test () = let equality_test () = let p (n: string ) = Path.of_string n |> Result.get Assert.are_equal (p "/etc") (p "/etc/") - +(* [] let parent_test () = let p (n: string ) = Path.of_string n |> Result.get @@ -62,3 +63,4 @@ let parent_test () = "/etc/" |> test |> Assert.are_seq_equal ["/"] "/etc/conf" |> test |> Assert.are_seq_equal [p "/etc"] "/etc/../etc" |> test |> Assert.ok_is_equal (p "/etc") +*)