mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-16 18:10:14 +00:00
Add a deriver for encoding lists
This commit is contained in:
parent
0dfdcf5523
commit
e83175cf75
2 changed files with 203 additions and 1 deletions
|
@ -712,4 +712,22 @@ fn recursive_tag_union() {
|
|||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list() {
|
||||
derive_test(v!(Symbol::LIST_LIST v!(STR)), |golden| {
|
||||
assert_snapshot!(golden, @r###"
|
||||
# derived for List Str
|
||||
# List val -[[toEncoder_list(0)]]-> Encoder fmt | fmt has EncoderFormatting, val has Encoding
|
||||
# List val -[[toEncoder_list(0)]]-> (List U8, fmt -[[] + fmt:Encode.list(19):4]-> List U8) | fmt has EncoderFormatting, val has Encoding
|
||||
# Specialization lambda sets:
|
||||
# @<1>: [[toEncoder_list(0)]]
|
||||
# @<2>: [[] + fmt:Encode.list(19):4] | fmt has EncoderFormatting
|
||||
#Derived.toEncoder_list =
|
||||
\#Derived.lst ->
|
||||
Encode.list #Derived.lst \#Derived.elem -> Encode.toEncoder #Derived.elem
|
||||
"###
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
// }}} deriver tests
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue