Releases: eed3si9n/verify
1.0.0
Verify 1.0.0 is cross published to the following build matrix:
Scala Version | JVM | JS (1.x) | JS (0.6.x) | Native (0.5.x) | Native (0.4.x) | Native (0.3.x) |
---|---|---|---|---|---|---|
3.x | ✅ | ✅ | n/a | ✅ | ✅ | n/a |
2.13.x | ✅ | ✅ | ✅ | ✅ | ✅ | n/a |
2.12.x | ✅ | ✅ | ✅ | ✅ | ✅ | n/a |
2.11.x | ✅ | ✅ | ✅ | n/a | ✅ | ✅ |
Fix
Back publishing
- Adds Scala Native 0.4.0 support #122 by @JD557
- Adds Scala 3 support for Scala Native #176 by @xuwei-k
About Verify
Verify is MiniTest + Expecty + SourceCode aimed to provide minimalist unit testing with zero transitive dependencies.
0.2.0
0.2.0 is cross published to Scala 2.11, 2.12, 2.13, Dotty, Scala.js 0.6.x and Scala Native 0.3.x.
String diffing
Verify 0.2.0 adds assertEquals(expected: String, found: String,[message: => String])
that implements String diffing.
assertEquals(str1, "Don't " + str2, "custom message")
The above test fails as follows:
logging
The log now outputs to sbt log - #29
If you want non-buffered log the following might be useful:
Test / logBuffered := false
Test / parallelExecution := false
about scala-verify
scala-verify is a fork of Minitest + SourceCode to prepare for eventual merge into scala/scala.
The purpose of scala-verify is to create a cross-platform, zero-dependency, minimal, testing framework for bootstrapping the toolchain and a few foundational third-party libraries.
See scala/scala-dev#641.
0.1.0
scala-verify is a fork of Minitest + SourceCode to prepare for eventual merge into scala/scala.
The purpose of scala-verify is to create a cross-platform, zero-dependency, minimal, testing framework for bootstrapping the toolchain and a few foundational third-party libraries.
See scala/scala-dev#641.
0.1.0 is cross published to Scala 2.11, 2.12, 2.13, Dotty, Scala.js 0.6.x and Scala Native 0.3.x.
setup
// use the %%% operator for Scala.js
libraryDependencies += "com.eed3si9n.verify" %% "verify" % "0.1.0" % Test
testFrameworks += new TestFramework("verify.runner.Framework")
BasicTestSuite
Here's BasicTestSuite:
import verify._
object SomethingTest extends BasicTestSuite {
test("addition") {
assert(2 == 1 + 1)
}
test("failing test") {
case class Person(name: String = "Fred", age: Int = 42) {
def say(words: String*) = words.mkString(" ")
}
assert(Person().say("ping", "pong") == "pong pong")
}
test("should throw") {
class DummyException extends RuntimeException("DUMMY")
def test(): String = throw new DummyException
intercept[DummyException] {
test()
}
}
}
In the context of BasicTestSuite
, assert(...)
function is wired up to power assertion,
as known in Groovy. The above failing test would result to the following:
- failing test *** FAILED ***
assertion failed
assert(Person().say("ping", "pong") == "pong pong")
| | |
| ping pong false
Person(Fred,42)
verify.asserts.PowerAssert$AssertListener.expressionRecorded(PowerAssert.scala:38)
verify.asserts.RecorderRuntime.recordExpression(RecorderRuntime.scala:39)
example.tests.SimpleTest$.$anonfun$new$9(SimpleTest.scala:54)
For more details see README.