5import Data.Either (Either(..))
6import Data.Semigroup.Foldable (intercalateMap)
8import Foreign (Foreign)
9import Test.Spec.Assertions (fail)
10import Type.Proxy (Proxy(..))
11import Yoga.JSON (class ReadForeign, class WriteForeign, read, readJSON, write, writeJSON)
12import Yoga.JSON.Error (renderHumanError, toJSONPath)
14roundtrips ∷ ∀ a. Show a ⇒ Eq a ⇒ ReadForeign a ⇒ WriteForeign a ⇒ a → Aff Unit
16 x # write # shouldRead (Proxy ∷ _ a)
17 x # writeJSON # shouldReadJSON (Proxy ∷ _ a)
19shouldRead ∷ ∀ a. ReadForeign a ⇒ Proxy a → Foreign → Aff Unit
20shouldRead _ = read >>> case _ of
21 Left e → fail (intercalateMap "\n" renderHumanError e <> "\n" <> intercalateMap "\n" toJSONPath e)
22 Right (_ ∷ a) → pure unit
24shouldReadJSON ∷ ∀ a. ReadForeign a ⇒ Proxy a → String → Aff Unit
25shouldReadJSON _ = readJSON >>> case _ of
26 Left e → fail (intercalateMap "\n" renderHumanError e <> "\n" <> intercalateMap "\n" toJSONPath e)
27 Right (_ ∷ a) → pure unit
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