Skip to content
This repository has been archived by the owner on May 22, 2022. It is now read-only.

Commit

Permalink
More tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
htmldoug committed Dec 12, 2018
1 parent 7331165 commit fb338c0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/sbt-test/sbt-lock/staleHash/test
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Precondition: jackson is inherited from transitiveProject.
> reload
> thisProject/checkExistsDependencyClasspath "com.fasterxml.jackson.core" "jackson-core" "2.2.2"
> thisProject/assertSbtLockHashIsUpToDate
> thisProject/assertSbtLockHashIsUpToDateInThisBuild

# Update the jackson version in transitiveProject
$ delete transitiveProject/build.sbt
Expand All @@ -12,3 +14,9 @@ $ copy-file transitiveProject/build.sbt.changed.txt transitiveProject/build.sbt
> reload
> thisProject/checkExistsDependencyClasspath "com.fasterxml.jackson.core" "jackson-core" "2.2.3"
> thisProject/checkAbsentDependencyClasspath "com.fasterxml.jackson.core" "jackson-core" "2.2.2"

# hash of thisProject has not changed:
> thisProject/assertSbtLockHashIsUpToDate

# but a hash of its dependency has changed:
-> thisProject/assertSbtLockHashIsUpToDateInThisBuild
14 changes: 14 additions & 0 deletions src/sbt-test/sbt-lock/staleHash/thisProject/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,17 @@ InputKey[Unit]("checkAbsentDependencyClasspath") := {
s"${module.mkString(":")} should not exist in dependencyClasspath: ${(dependencyClasspath in Compile).value}"
)
}

TaskKey[Unit]("assertSbtLockHashIsUpToDate") := {
assert(
sbtLockHashIsUpToDate.value,
s"sbtLockHashIsUpToDate.value was not true"
)
}

TaskKey[Unit]("assertSbtLockHashIsUpToDateInThisBuild") := {
assert(
(sbtLockHashIsUpToDate in ThisBuild).value,
s"(sbtLockHashIsUpToDate in ThisBuild).value was not true"
)
}

0 comments on commit fb338c0

Please sign in to comment.