Last active
February 3, 2026 20:24
-
-
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/e98207f4829648f5c186148e83ac372ce0bbd859
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // summary : simple scalatest test framework usage. | |
| // keywords : scala, scalatest, pi, @testable | |
| // publish : gist | |
| // authors : David Crosson | |
| // license : Apache License Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt) | |
| // 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.4.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