mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
Remove explicit string deriving code in favor of immediate
This commit is contained in:
parent
9a66e936a8
commit
568e8d9475
3 changed files with 1 additions and 113 deletions
|
@ -515,25 +515,7 @@ fn immediates() {
|
|||
check_immediate(v!(DEC), Symbol::ENCODE_DEC);
|
||||
check_immediate(v!(F32), Symbol::ENCODE_F32);
|
||||
check_immediate(v!(F64), Symbol::ENCODE_F64);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn string() {
|
||||
derive_test(v!(STR), |golden| {
|
||||
assert_snapshot!(golden, @r###"
|
||||
# derived for Str
|
||||
# Str -[[toEncoder_string(0)]]-> Encoder fmt | fmt has EncoderFormatting
|
||||
# Str -[[toEncoder_string(0)]]-> (List U8, fmt -[[custom(2) Str]]-> List U8) | fmt has EncoderFormatting
|
||||
# Specialization lambda sets:
|
||||
# @<1>: [[toEncoder_string(0)]]
|
||||
# @<2>: [[custom(2) Str]]
|
||||
#Derived.toEncoder_string =
|
||||
\#Derived.s ->
|
||||
Encode.custom \#Derived.bytes, #Derived.fmt ->
|
||||
Encode.appendWith #Derived.bytes (Encode.string #Derived.s) #Derived.fmt
|
||||
"###
|
||||
)
|
||||
})
|
||||
check_immediate(v!(STR), Symbol::ENCODE_STRING);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue