mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
git tests: kotlinify
This commit is contained in:
@@ -253,7 +253,7 @@ class GitPushOperationSingleRepoTest : GitPushOperationBaseTest() {
|
||||
val log = git("log -3 --pretty=%H#%s")
|
||||
val commits = StringUtil.splitByLines(log)
|
||||
val lastCommitMsg = commits[0].split("#".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()[1]
|
||||
assertTrue("The last commit doesn't look like a merge commit: " + lastCommitMsg, lastCommitMsg.contains("Merge"))
|
||||
assertTrue("The last commit doesn't look like a merge commit: $lastCommitMsg", lastCommitMsg.contains("Merge"))
|
||||
assertEquals(hash, commits[1].split("#".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()[0])
|
||||
assertEquals(broHash, commits[2].split("#".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()[0])
|
||||
|
||||
@@ -392,13 +392,13 @@ class GitPushOperationSingleRepoTest : GitPushOperationBaseTest() {
|
||||
})
|
||||
|
||||
push("master", "origin/master")
|
||||
assertTrue("Default action in rejected-push dialog is incorrect: " + defaultActionName,
|
||||
defaultActionName.toLowerCase().contains("rebase"))
|
||||
assertTrue("Default action in rejected-push dialog is incorrect: $defaultActionName",
|
||||
defaultActionName.toLowerCase().contains("rebase"))
|
||||
|
||||
git("config branch.master.rebase false")
|
||||
push("master", "origin/master")
|
||||
assertTrue("Default action in rejected-push dialog is incorrect: " + defaultActionName,
|
||||
defaultActionName.toLowerCase().contains("merge"))
|
||||
assertTrue("Default action in rejected-push dialog is incorrect: $defaultActionName",
|
||||
defaultActionName.toLowerCase().contains("merge"))
|
||||
}
|
||||
|
||||
fun `test respect branch default setting for silent update when rejected push`() {
|
||||
@@ -487,7 +487,7 @@ class GitPushOperationSingleRepoTest : GitPushOperationBaseTest() {
|
||||
|
||||
private fun assertPushed(expectedHash: String, branch: String) {
|
||||
Executor.cd(parentRepo.path)
|
||||
val actualHash = git("log -1 --pretty=%H " + branch)
|
||||
val actualHash = git("log -1 --pretty=%H $branch")
|
||||
assertEquals(expectedHash, actualHash)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user