mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-02 05:48:17 +00:00
Update solve tests
This commit is contained in:
parent
67d0a3d36f
commit
b7b0af0d45
1 changed files with 15 additions and 15 deletions
|
|
@ -6330,14 +6330,14 @@ mod solve_expr {
|
|||
r#"
|
||||
app "test" provides [zeroEncoder] to "./platform"
|
||||
|
||||
Encoder fmt := List U8, fmt -> List U8 | fmt has Format
|
||||
MEncoder fmt := List U8, fmt -> List U8 | fmt has Format
|
||||
|
||||
Format has it : fmt -> {} | fmt has Format
|
||||
|
||||
zeroEncoder = @Encoder \lst, _ -> lst
|
||||
zeroEncoder = @MEncoder \lst, _ -> lst
|
||||
"#
|
||||
),
|
||||
"Encoder a | a has Format",
|
||||
"MEncoder a | a has Format",
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -6348,27 +6348,27 @@ mod solve_expr {
|
|||
r#"
|
||||
app "test" provides [myU8Bytes] to "./platform"
|
||||
|
||||
Encoder fmt := List U8, fmt -> List U8 | fmt has Format
|
||||
MEncoder fmt := List U8, fmt -> List U8 | fmt has Format
|
||||
|
||||
Encoding has
|
||||
toEncoder : val -> Encoder fmt | val has Encoding, fmt has Format
|
||||
MEncoding has
|
||||
toEncoder : val -> MEncoder fmt | val has MEncoding, fmt has Format
|
||||
|
||||
Format has
|
||||
u8 : U8 -> Encoder fmt | fmt has Format
|
||||
u8 : U8 -> MEncoder fmt | fmt has Format
|
||||
|
||||
appendWith : List U8, Encoder fmt, fmt -> List U8 | fmt has Format
|
||||
appendWith = \lst, (@Encoder doFormat), fmt -> doFormat lst fmt
|
||||
appendWith : List U8, MEncoder fmt, fmt -> List U8 | fmt has Format
|
||||
appendWith = \lst, (@MEncoder doFormat), fmt -> doFormat lst fmt
|
||||
|
||||
toBytes : val, fmt -> List U8 | val has Encoding, fmt has Format
|
||||
toBytes : val, fmt -> List U8 | val has MEncoding, fmt has Format
|
||||
toBytes = \val, fmt -> appendWith [] (toEncoder val) fmt
|
||||
|
||||
|
||||
Linear := {} has [Format {u8}]
|
||||
|
||||
u8 = \n -> @Encoder (\lst, @Linear {} -> List.append lst n)
|
||||
u8 = \n -> @MEncoder (\lst, @Linear {} -> List.append lst n)
|
||||
#^^{-1}
|
||||
|
||||
MyU8 := U8 has [Encoding {toEncoder}]
|
||||
MyU8 := U8 has [MEncoding {toEncoder}]
|
||||
|
||||
toEncoder = \@MyU8 n -> u8 n
|
||||
#^^^^^^^^^{-1}
|
||||
|
|
@ -6378,8 +6378,8 @@ mod solve_expr {
|
|||
"#
|
||||
),
|
||||
@r###"
|
||||
Linear#u8(10) : U8 -[[u8(10)]]-> Encoder Linear
|
||||
MyU8#toEncoder(11) : MyU8 -[[toEncoder(11)]]-> Encoder fmt | fmt has Format
|
||||
Linear#u8(10) : U8 -[[u8(10)]]-> MEncoder Linear
|
||||
MyU8#toEncoder(11) : MyU8 -[[toEncoder(11)]]-> MEncoder fmt | fmt has Format
|
||||
myU8Bytes : List U8
|
||||
"###
|
||||
)
|
||||
|
|
@ -6537,7 +6537,7 @@ mod solve_expr {
|
|||
indoc!(
|
||||
r#"
|
||||
app "test"
|
||||
imports [Encode.{ toEncoder, Encoding, custom }]
|
||||
imports [Encode.{ toEncoder, custom }]
|
||||
provides [main] to "./platform"
|
||||
|
||||
A := {} has [Encoding {toEncoder}]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue