1module Variant.Spec where
5import Data.Variant (Variant)
6import Data.Variant as Variant
7import Test.Spec (Spec, describe, it)
8import Test.Spec.Assertions (shouldEqual)
9import Type.Proxy (Proxy(..))
10import Yoga.Fetch.Om.Variant (only)
13spec = describe "only" do
14 it "extracts single variant value - record" do
16 variant :: Variant (ok :: { id :: Int, name :: String })
17 variant = Variant.inj (Proxy :: _ "ok") { id: 42, name: "Alice" }
19 result `shouldEqual` { id: 42, name: "Alice" }
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