Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active February 3, 2026 20:25
Show Gist options
  • Select an option

  • Save dacr/f2b05be155d456e6055944975dd2c54e to your computer and use it in GitHub Desktop.

Select an option

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/9abebf58b8ab6b263c4fe3803833a41ed0382f4b
// summary : ZIO cheat sheet as tests
// keywords : scala, cheat-sheet, zio, @testable
// publish : gist
// authors : David Crosson
// license : Apache License Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
// 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