Skip to content

Commit

Permalink
Fix pebkac
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGilham committed Apr 6, 2024
1 parent cb49107 commit 8489283
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
2 changes: 1 addition & 1 deletion AltCover.Tests/TestCommon.fs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ module TestCommonTests =
test <@ (Maybe false 1 2) = 2 @>
test <@ SolutionDir() |> String.IsNullOrEmpty |> not @>
test <@ SolutionDir() = AltCover.SolutionRoot.location @>
// test <@ where.StartsWith(AltCover.SolutionRoot.location, StringComparison.Ordinal) @>
test <@ where.StartsWith(AltCover.SolutionRoot.location, StringComparison.Ordinal) @>

[<Test>]
let SelfTest () =
Expand Down
18 changes: 2 additions & 16 deletions AltCover.Tests/Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2871,21 +2871,14 @@ module AltCoverTests =
Destinations = [] } ]
|> Seq.toList

// work round my local symlinks
let where =
Assembly.GetExecutingAssembly().Location

let index = where.IndexOf "_Binaries"
let at = where.Substring(0, index)

deeper
|> List.iter (fun n ->
let text =
(sprintf "%A" n)
.Replace(
"Mono.Cecil.Cil.Document",
Path
.Combine(at, "Samples/Sample1/Program.cs")
.Combine(SolutionRoot.location, "Samples/Sample1/Program.cs")
.Replace('/', Path.DirectorySeparatorChar)
)

Expand Down Expand Up @@ -3761,19 +3754,12 @@ module AltCoverTests =

use reader = new StreamReader(stream)

// work round my local symlinks
let where =
Assembly.GetExecutingAssembly().Location

let index = where.IndexOf "_Binaries"
let at = where.Substring(0, index)

let expected =
reader
.ReadToEnd()
.Replace(
"/_//Samples/Sample4/Tests.fs", // Not compiled deterministic
(Path.Combine(at, "Samples/Sample4/Tests.fs")
(Path.Combine(SolutionDir(), "Samples/Sample4/Tests.fs")
|> canonicalPath)
.Replace("\\", "\\\\")
)
Expand Down

0 comments on commit 8489283

Please sign in to comment.