Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active May 13, 2023 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dacr/78bb969a26d7394900396fd8ebd0142b to your computer and use it in GitHub Desktop.
Save dacr/78bb969a26d7394900396fd8ebd0142b to your computer and use it in GitHub Desktop.
simple scalatest test framework usage. / published by https://github.com/dacr/code-examples-manager #2071bbdd-548f-4683-9b5b-37d6ca238609/d4fe55f5143bcdfb133f2b6b0dacef049e048f42
// summary : simple scalatest test framework usage.
// keywords : scala, scalatest, pi, @testable
// publish : gist
// authors : David Crosson
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2)
// id : 2071bbdd-548f-4683-9b5b-37d6ca238609
// created-on : 2020-10-11T15:05:16Z
// managed-by : https://github.com/dacr/code-examples-manager
// run-with : scala-cli $file
// ---------------------
//> using scala "3.2.2"
//> using dep "org.scalatest::scalatest:3.2.15"
// ---------------------
import org.scalatest.*, flatspec.*, matchers.*
object PiTest extends AnyFlatSpec with should.Matchers {
"pi calculus" should "return a precise enough pi value" in {
math.Pi shouldBe 3.14158d +- 0.001d
}
}
PiTest.execute()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment