1module StreamDecode.Spec where
5import Data.ArrayBuffer.Types (Uint8Array)
6import Data.String as String
8import Effect.Class (liftEffect)
9import Effect.Exception (throwException)
10import Test.Spec (Spec, describe, it)
11import Test.Spec.Assertions (shouldEqual)
12import Yoga.Fetch.Om.StreamDecode (decodeStream)
15import Yoga.Om.Strom as Strom
17foreign import uint8Array :: Array Int -> Uint8Array
19runOm :: forall a. Om {} () a -> Aff a
20runOm om = Om.runOm {} { exception: \err -> liftEffect (throwException err) } om
23spec = describe "StreamDecode" do
24 it "preserves UTF-8 code points split across chunks" do
28 , uint8Array [ 0x82, 0xac ]
30 # decodeStream @String
32 String.joinWith "" chunks `shouldEqual` "€"
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