3import Prelude (Unit, bind, pure, discard, map, negate, ($), (<$>), (=<<), (<>))
4import Data.ArrayBuffer.Types (ArrayBuffer,Uint8Array)
5import Data.ArrayBuffer.Typed as AT
6import Data.UInt as UInt
8import Test.Assert (assertEqual')
9import Data.ArrayBuffer.Builder
11asBytes :: ArrayBuffer -> Effect (Array Int)
13 x' :: Uint8Array <- AT.whole x
14 map UInt.toInt <$> AT.toArray x'
16putTest :: String -> Array Int -> PutM Effect Unit -> Effect Unit
17putTest label expected put = do
18 actual <- asBytes =<< execPut put
19 assertEqual' label {actual,expected}
21buildTest :: String -> Array Int -> Effect Builder -> Effect Unit
22buildTest label expected bldr = do
23 actual <- asBytes =<< execBuilder =<< bldr
24 assertEqual' label {actual,expected}
28 putTest "Test 0" [6,7,8] $ do
33 putTest "Test 1" [255,254] $ do
36 putTest "Test 3" [3,0,0,0] $ do
39 buildTest "Test 4" [1,2,3,4] $ do
44 pure $ singleton b1 <> singleton b2 <> singleton b3 <> singleton b4
46 buildTest "Test 5" [1,2,3,4] $ do
51 pure $ singleton b1 <>> singleton b2 <>> singleton b3 <>> singleton b4
53 buildTest "Test 6" [1,2,3,4] $ do
58 pure $ singleton b1 <> (singleton b2 <> singleton b3) <> singleton b4
60 buildTest "Test 6" [1,2,3,4,5,6,7,8] $ do
69 pure $ singleton b1 <> (singleton b2 <> singleton b3) <> singleton b4
70 <> singleton b5 <> (singleton b6 <> singleton b7) <> singleton b8
72 buildTest "Test 7" [1,2,3,4,5,6,7,8] $ do
81 pure $ ((singleton b1 <> singleton b2) <> (singleton b3 <> singleton b4))
82 <> ((singleton b5 <> singleton b6) <> (singleton b7 <> singleton b8))
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