diff --git a/mutannot.fsx b/mutannot.fsx index 93c2c13..821447f 100755 --- a/mutannot.fsx +++ b/mutannot.fsx @@ -224,26 +224,6 @@ let tempRoot = Path.Combine(Path.GetTempPath(), $"fscheck-mutants.{Guid.NewGuid( let worktreePath = Path.Combine(tempRoot, "worktree") let patchPath = Path.Combine(tempRoot, "current.patch") -let splitNullSeparated (text: string) = - text.Split('\000', StringSplitOptions.RemoveEmptyEntries) - |> Array.toList - -let repoRelativePath (path: string) = - path.Replace('/', Path.DirectorySeparatorChar) - -let listUntrackedFiles () = - let exitCode, stdout, stderr = captureProcess repoRoot "git" [ "ls-files"; "--others"; "--exclude-standard"; "-z" ] - if exitCode <> 0 then fail stderr - splitNullSeparated stdout - -let copyFileIntoWorktree (relativePath: string) = - let sourcePath = Path.Combine(repoRoot, repoRelativePath relativePath) - let destinationPath = Path.Combine(worktreePath, repoRelativePath relativePath) - let destinationDir = Path.GetDirectoryName destinationPath - if not (String.IsNullOrEmpty destinationDir) then - Directory.CreateDirectory(destinationDir) |> ignore - File.Copy(sourcePath, destinationPath, true) - let cleanup () = if Directory.Exists worktreePath then let _ = captureProcess repoRoot "git" [ "worktree"; "remove"; "--force"; worktreePath ] @@ -253,7 +233,6 @@ let cleanup () = let createWorktree () = Directory.CreateDirectory(tempRoot) |> ignore - let untrackedFiles = listUntrackedFiles () let exitCode, diffText, stderr = captureProcess repoRoot "git" [ "diff"; "--binary"; "HEAD" ] if exitCode <> 0 then fail stderr File.WriteAllText(patchPath, diffText) @@ -269,14 +248,7 @@ let createWorktree () = let exitCode4, _, stderr4 = captureProcess worktreePath "git" [ "apply"; patchPath ] if exitCode4 <> 0 then fail stderr4 - for relativePath in untrackedFiles do - copyFileIntoWorktree relativePath - -let fullyQualifiedTestName mutation = - let declaringType = mutation.DeclaringType.Replace('+', '.') - $"{declaringType}.{mutation.TestName}" - -let testFilter mutation = $"FullyQualifiedName={fullyQualifiedTestName mutation}" +let testFilter mutation = $"FullyQualifiedName~{mutation.TestName}" let runMutation (mutation: MutationCase) = let targetFile = Path.Combine(worktreePath, mutation.File.Replace('/', Path.DirectorySeparatorChar))