5import Data.Maybe (Maybe(..), fromJust)
6import Data.String (length)
7import Data.UUID (genUUID, genv3UUID, genv5UUID, parseUUID)
9import Effect.Class (liftEffect)
10import Effect.Unsafe (unsafePerformEffect)
11import Partial.Unsafe (unsafePartial)
12import Test.Spec (it, describe)
13import Test.Spec.Assertions (shouldEqual)
14import Test.Spec.Reporter.Console (consoleReporter)
15import Test.Spec.Runner (run)
18main = run [consoleReporter] do
22 it "`genUUID` returns a uuid" do
23 let uuid = unsafePerformEffect genUUID
24 (length <<< show) uuid `shouldEqual` 36
26 it "`genv3UUID` returns a uuid" do
27 namespace <- liftEffect genUUID
28 let uuid = genv3UUID "foo" namespace
29 (length <<< show) uuid `shouldEqual` 36
31 it "`genv5UUID` returns a uuid" do
32 namespace <- liftEffect genUUID
33 let uuid = genv5UUID "foo" namespace
34 (length <<< show) uuid `shouldEqual` 36
36 it "`parseUUID` parses a valid uuid as Just UUID" do
37 let uuidStr = "d0778cf2-3a4c-42ef-acbd-1269b6bec204"
38 uuid = parseUUID uuidStr
39 uuidStr `shouldEqual` (show $ unsafePartial $ fromJust uuid)
41 it "`parseUUID` parses an invalid uuid as Nothing" do
43 uuid = parseUUID uuidStr
44 Nothing `shouldEqual` uuid
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list