File tree 1 file changed +17
-0
lines changed
modules/core/src/test/scala/org/scalasteward/core/git
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,23 @@ class FileGitAlgTest extends FunSuite {
143
143
test(" version" ) {
144
144
assert(ioGitAlg.version.unsafeRunSync().nonEmpty)
145
145
}
146
+
147
+ test(" diff" ) {
148
+ val repo = rootDir / " diff"
149
+ val wip = Branch (" wip" )
150
+ val p = for {
151
+ _ <- supplement.createRepo(repo)
152
+ _ <- ioFileAlg.writeFile(repo / " test.txt" , " hello" )
153
+ _ <- supplement.git(" add" , " test.txt" )(repo)
154
+ _ <- ioGitAlg.commitAll(repo, " Add test.txt" )
155
+ // work on wip
156
+ _ <- ioGitAlg.createBranch(repo, wip)
157
+ c1 <- ioGitAlg.diff(repo, master)
158
+ _ <- ioFileAlg.writeFile(repo / " test.txt" , " hello world" )
159
+ c2 <- ioGitAlg.diff(repo, master)
160
+ } yield (c1.isEmpty, c2.isEmpty)
161
+ assertEquals(p.unsafeRunSync(), (true , false ))
162
+ }
146
163
}
147
164
148
165
object FileGitAlgTest {
You can’t perform that action at this time.
0 commit comments