mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
Update to use new square brace formatting
This commit is contained in:
parent
0fae5b0bac
commit
4eec34becf
120 changed files with 1149 additions and 1155 deletions
|
@ -19,7 +19,7 @@ fn hash_specialization() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [ main ] to "./platform"
|
||||
app "test" provides [main] to "./platform"
|
||||
|
||||
Hash has
|
||||
hash : a -> U64 | a has Hash
|
||||
|
@ -42,7 +42,7 @@ fn hash_specialization_multiple_add() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [ main ] to "./platform"
|
||||
app "test" provides [main] to "./platform"
|
||||
|
||||
Hash has
|
||||
hash : a -> U64 | a has Hash
|
||||
|
@ -69,7 +69,7 @@ fn alias_member_specialization() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [ main ] to "./platform"
|
||||
app "test" provides [main] to "./platform"
|
||||
|
||||
Hash has
|
||||
hash : a -> U64 | a has Hash
|
||||
|
@ -94,7 +94,7 @@ fn ability_constrained_in_non_member_usage() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [ result ] to "./platform"
|
||||
app "test" provides [result] to "./platform"
|
||||
|
||||
Hash has
|
||||
hash : a -> U64 | a has Hash
|
||||
|
@ -119,7 +119,7 @@ fn ability_constrained_in_non_member_usage_inferred() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [ result ] to "./platform"
|
||||
app "test" provides [result] to "./platform"
|
||||
|
||||
Hash has
|
||||
hash : a -> U64 | a has Hash
|
||||
|
@ -143,7 +143,7 @@ fn ability_constrained_in_non_member_multiple_specializations() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [ result ] to "./platform"
|
||||
app "test" provides [result] to "./platform"
|
||||
|
||||
Hash has
|
||||
hash : a -> U64 | a has Hash
|
||||
|
@ -171,7 +171,7 @@ fn ability_constrained_in_non_member_multiple_specializations_inferred() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [ result ] to "./platform"
|
||||
app "test" provides [result] to "./platform"
|
||||
|
||||
Hash has
|
||||
hash : a -> U64 | a has Hash
|
||||
|
@ -198,7 +198,7 @@ fn ability_used_as_type_still_compiles() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [ result ] to "./platform"
|
||||
app "test" provides [result] to "./platform"
|
||||
|
||||
Hash has
|
||||
hash : a -> U64 | a has Hash
|
||||
|
@ -226,7 +226,7 @@ fn encode() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [ myU8Bytes ] to "./platform"
|
||||
app "test" provides [myU8Bytes] to "./platform"
|
||||
|
||||
Encoder fmt := List U8, fmt -> List U8 | fmt has Format
|
||||
|
||||
|
@ -243,7 +243,7 @@ fn encode() {
|
|||
toBytes = \val, fmt -> appendWith [] (toEncoder val) fmt
|
||||
|
||||
|
||||
Linear := {}
|
||||
Linear := {}
|
||||
|
||||
# impl Format for Linear
|
||||
u8 = \n -> @Encoder (\lst, @Linear {} -> List.append lst n)
|
||||
|
@ -272,9 +272,9 @@ fn decode() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [ myU8 ] to "./platform"
|
||||
app "test" provides [myU8] to "./platform"
|
||||
|
||||
DecodeError : [ TooShort, Leftover (List U8) ]
|
||||
DecodeError : [TooShort, Leftover (List U8)]
|
||||
|
||||
Decoder val fmt := List U8, fmt -> { result: Result val DecodeError, rest: List U8 } | fmt has DecoderFormatting
|
||||
|
||||
|
@ -314,7 +314,7 @@ fn decode() {
|
|||
{ result: Result.map result (\n -> @MyU8 n), rest }
|
||||
|
||||
myU8 =
|
||||
when fromBytes [ 15 ] (@Linear {}) is
|
||||
when fromBytes [15] (@Linear {}) is
|
||||
Ok (@MyU8 n) -> n
|
||||
_ -> 27u8
|
||||
"#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue