Last active
May 6, 2023 15:40
-
-
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
This file contains 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 : 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