Re-format and re-run all acceptance tests.

This commit is contained in:
KtorZ
2024-01-20 10:43:17 +01:00
parent 9ee2d58ba3
commit b50e4ab63a
77 changed files with 449 additions and 830 deletions

View File

@@ -37,8 +37,7 @@ fn do_union_with(
with: fn(ByteArray, value, value) -> Option<value>,
) -> List<(ByteArray, value)> {
when left is {
[] ->
right
[] -> right
[(k, v), ..rest] ->
do_union_with(rest, do_insert_with(right, k, v, with), with)
}
@@ -58,8 +57,7 @@ fn do_insert_with(
when with(k, v, v2) is {
Some(combined) ->
[(k, combined), ..rest]
None ->
rest
None -> rest
}
} else {
[(k2, v2), ..do_insert_with(rest, k, v, with)]

View File

@@ -35,8 +35,7 @@ pub fn add(left v0: Value, right v1: Value) -> Value {
a0,
a1,
fn(_, q0, q1) {
let q =
q0 + q1
let q = q0 + q1
if q == 0 {
None
} else {
@@ -46,19 +45,15 @@ pub fn add(left v0: Value, right v1: Value) -> Value {
)
when dict.toList(asset) is {
[] ->
None
_ ->
Some(asset)
[] -> None
_ -> Some(asset)
}
},
)
}
test add_1() {
let v1 =
from_lovelace(1)
let v2 =
from_lovelace(-1)
let v1 = from_lovelace(1)
let v2 = from_lovelace(-1)
add(v1, v2) == dict.new()
}