mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
minor improvement
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
This commit is contained in:
parent
df58a4ff07
commit
af389a9792
1 changed files with 6 additions and 6 deletions
|
@ -94,10 +94,10 @@ appendWith = \lst, @Encoder doEncoding, fmt -> doEncoding lst fmt
|
|||
##
|
||||
## ```
|
||||
## expect
|
||||
## actual = Encode.append [] { foo: "Bar" } Core.json
|
||||
## actual = Encode.append [] { foo: 43 } Core.json
|
||||
## expected = Str.toUtf8 """{"foo":43}"""
|
||||
##
|
||||
## # Check that the list has grown
|
||||
## !(List.isEmpty actual)
|
||||
## actual == expected
|
||||
## ```
|
||||
append : List U8, val, fmt -> List U8 where val implements Encoding, fmt implements EncoderFormatting
|
||||
append = \lst, val, fmt -> appendWith lst (toEncoder val) fmt
|
||||
|
@ -106,10 +106,10 @@ append = \lst, val, fmt -> appendWith lst (toEncoder val) fmt
|
|||
##
|
||||
## ```
|
||||
## expect
|
||||
## value = 42
|
||||
## fooRec = { foo: 42 }
|
||||
##
|
||||
## actual = Encode.toBytes value Core.json
|
||||
## expected = [52, 50] # ASCII codes for 4 and 2
|
||||
## actual = Encode.toBytes fooRec Core.json
|
||||
## expected = Str.toUtf8 """{"foo":42}"""
|
||||
##
|
||||
## actual == expected
|
||||
## ```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue