Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active May 6, 2023 15:40
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/f2b05be155d456e6055944975dd2c54e to your computer and use it in GitHub Desktop.
Save dacr/f2b05be155d456e6055944975dd2c54e to your computer and use it in GitHub Desktop.
ZIO cheat sheet as tests / published by https://github.com/dacr/code-examples-manager #8d81f2a8-ad32-4503-8e8e-f3b595d1673f/7a506824f693ebbdf5894d8fd90e4001d1fd2701
// summary : ZIO cheat sheet as tests
// keywords : scala, cheat-sheet, zio, @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 : 8d81f2a8-ad32-4503-8e8e-f3b595d1673f
// created-on : 2022-01-07T15:49:33+01:00
// managed-by : https://github.com/dacr/code-examples-manager
// run-with : scala-cli $file
// ---------------------
//> using scala "3.2.2"
//> using dep "dev.zio::zio:2.0.13"
//> using dep "dev.zio::zio-test:2.0.13"
// ---------------------
import zio.*
import zio.test.*
import zio.test.Assertion.*
import zio.test.TestAspect.{ignore, failing}
object ClassicTests extends ZIOSpecDefault {
def spec = suite("zio cheat sheet using tests")(
// --------------------------------------------------------------------------------------
test("functional UUID feature") {
for {
uuid1 <- Random.nextUUID
uuid2 <- Random.nextUUID
} yield assertTrue(uuid1 != uuid2)
}
)
}
ClassicTests.main(Array.empty)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment