Re-format and re-run all acceptance tests.
This commit is contained in:
@@ -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)]
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user