Skip to content

Commit

Permalink
GitOpsTest: add implicit location, shown with fail
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Nov 27, 2024
1 parent d38fa85 commit 3dcf769
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1564,7 +1564,7 @@ class Router(formatOps: FormatOps) {
rightIsCloseDelimToAddTrailingComma(lc, nextNonComment(nextFt))
) Seq(Split(Space, 0), Split(Newline, 1))
else Seq(Split(Newline, 0))
case FT(_: T.Comma, right, _) if !leftOwner.is[Template] =>
case FT(_: T.Comma, _, _) if !leftOwner.is[Template] =>
def forBinPack(binPack: BinPack.Site, callSite: Boolean) =
if (binPack eq BinPack.Site.Never) None
else optimizationEntities.argument.map { nextArg =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ class GitOpsTest extends FunSuite {
override def beforeEach(context: BeforeEach): Unit = {
path = AbsoluteFile(Files.createTempDirectory(dirName))
ops = new GitOpsImpl(path)
init(ops)
init
// initial commit is needed
initFile = touch("initialfile")
add(initFile)(ops)
commit(ops)
add(initFile)
commit
}

override def afterEach(context: AfterEach): Unit =
Expand Down Expand Up @@ -341,20 +341,28 @@ private object GitOpsTest {
case Success(s) => s
}

def init(implicit ops: GitOpsImpl): Unit = git("init", "-b", defaultBranch)
def init(implicit ops: GitOpsImpl, loc: munit.Location): Unit =
git("init", "-b", defaultBranch)

def add(file: AbsoluteFile*)(implicit ops: GitOpsImpl): Unit =
def add(
file: AbsoluteFile*,
)(implicit ops: GitOpsImpl, loc: munit.Location): Unit =
git("add", file.map(_.toString()): _*)

def rm(file: AbsoluteFile*)(implicit ops: GitOpsImpl): Unit =
def rm(
file: AbsoluteFile*,
)(implicit ops: GitOpsImpl, loc: munit.Location): Unit =
git("rm", file.map(_.toString()): _*)

def commit(implicit ops: GitOpsImpl): Unit =
def commit(implicit ops: GitOpsImpl, loc: munit.Location): Unit =
git("commit", "-m", "'some-message'")

def checkout(br: String)(implicit ops: GitOpsImpl): Unit =
git("checkout", "$br")
def checkout(
br: String,
)(implicit ops: GitOpsImpl, loc: munit.Location): Unit = git("checkout", br)

def checkoutBr(newBr: String)(implicit ops: GitOpsImpl): Unit =
git("checkout", "-b", "$newBr")
def checkoutBr(
newBr: String,
)(implicit ops: GitOpsImpl, loc: munit.Location): Unit =
git("checkout", "-b", newBr)
}

0 comments on commit 3dcf769

Please sign in to comment.