Update solve tests

This commit is contained in:
Ayaz Hafiz 2022-09-21 10:27:35 -05:00
parent 67d0a3d36f
commit b7b0af0d45
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -6330,14 +6330,14 @@ mod solve_expr {
r#" r#"
app "test" provides [zeroEncoder] to "./platform" 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 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#" r#"
app "test" provides [myU8Bytes] to "./platform" 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 MEncoding has
toEncoder : val -> Encoder fmt | val has Encoding, fmt has Format toEncoder : val -> MEncoder fmt | val has MEncoding, fmt has Format
Format has 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 : List U8, MEncoder fmt, fmt -> List U8 | fmt has Format
appendWith = \lst, (@Encoder doFormat), fmt -> doFormat lst fmt 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 toBytes = \val, fmt -> appendWith [] (toEncoder val) fmt
Linear := {} has [Format {u8}] Linear := {} has [Format {u8}]
u8 = \n -> @Encoder (\lst, @Linear {} -> List.append lst n) u8 = \n -> @MEncoder (\lst, @Linear {} -> List.append lst n)
#^^{-1} #^^{-1}
MyU8 := U8 has [Encoding {toEncoder}] MyU8 := U8 has [MEncoding {toEncoder}]
toEncoder = \@MyU8 n -> u8 n toEncoder = \@MyU8 n -> u8 n
#^^^^^^^^^{-1} #^^^^^^^^^{-1}
@ -6378,8 +6378,8 @@ mod solve_expr {
"# "#
), ),
@r###" @r###"
Linear#u8(10) : U8 -[[u8(10)]]-> Encoder Linear Linear#u8(10) : U8 -[[u8(10)]]-> MEncoder Linear
MyU8#toEncoder(11) : MyU8 -[[toEncoder(11)]]-> Encoder fmt | fmt has Format MyU8#toEncoder(11) : MyU8 -[[toEncoder(11)]]-> MEncoder fmt | fmt has Format
myU8Bytes : List U8 myU8Bytes : List U8
"### "###
) )
@ -6537,7 +6537,7 @@ mod solve_expr {
indoc!( indoc!(
r#" r#"
app "test" app "test"
imports [Encode.{ toEncoder, Encoding, custom }] imports [Encode.{ toEncoder, custom }]
provides [main] to "./platform" provides [main] to "./platform"
A := {} has [Encoding {toEncoder}] A := {} has [Encoding {toEncoder}]