Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active May 25, 2024 10:18
Show Gist options
  • 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/80b2f6a573cf5df191588c24a0c4d8d4c517e40d
// 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.4.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