Skip to content

Commit

Permalink
Test for GitAlg diff
Browse files Browse the repository at this point in the history
  • Loading branch information
Devon Stewart committed Mar 20, 2021
1 parent c4527c2 commit 7cf89ac
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,23 @@ class FileGitAlgTest extends FunSuite {
test("version") {
assert(ioGitAlg.version.unsafeRunSync().nonEmpty)
}

test("diff") {
val repo = rootDir / "diff"
val wip = Branch("wip")
val p = for {
_ <- supplement.createRepo(repo)
_ <- ioFileAlg.writeFile(repo / "test.txt", "hello")
_ <- supplement.git("add", "test.txt")(repo)
_ <- ioGitAlg.commitAll(repo, "Add test.txt")
// work on wip
_ <- ioGitAlg.createBranch(repo, wip)
c1 <- ioGitAlg.diff(repo, master)
_ <- ioFileAlg.writeFile(repo / "test.txt", "hello world")
c2 <- ioGitAlg.diff(repo, master)
} yield (c1.isEmpty, c2.isEmpty)
assertEquals(p.unsafeRunSync(), (true, false))
}
}

object FileGitAlgTest {
Expand Down

0 comments on commit 7cf89ac

Please sign in to comment.