Skip to content

Commit

Permalink
Merge #2574
Browse files Browse the repository at this point in the history
2574: Decrease coverage requirement in UTxOIndexSpec r=Anviking a=Anviking


# Issue Number

#2575

<!-- Put here a reference to the issue that this PR relates to and which requirements it tackles. Jira issues of the form ADP- will be auto-linked. -->


# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] Decrease all `coverage 80` to `coverage 70` inside UTxOIndexSpec


# Comments


<!--
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
 ✓ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages.
-->


Co-authored-by: Johannes Lund <[email protected]>
  • Loading branch information
iohk-bors[bot] and Anviking authored Apr 2, 2021
2 parents 95bbd84 + d4c29e2 commit 7acc8ac
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/core/test/unit/Cardano/Wallet/Primitive/Types/UTxOIndexSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,11 @@ prop_selectRandom_one_withAdaOnly u = checkCoverage $ monadicIO $ do
prop_selectRandom_one_withAsset :: UTxOIndex -> AssetId -> Property
prop_selectRandom_one_withAsset u a = checkCoverage $ monadicIO $ do
result <- run $ UTxOIndex.selectRandom u (WithAsset a)
monitor $ cover 80 (a `Set.member` UTxOIndex.assets u)
monitor $ cover 70 (a `Set.member` UTxOIndex.assets u)
"index has the specified asset"
monitor $ cover 80 (Set.size (UTxOIndex.assets u) > 1)
monitor $ cover 70 (Set.size (UTxOIndex.assets u) > 1)
"index has more than one asset"
monitor $ cover 80 (isJust result)
monitor $ cover 70 (isJust result)
"selected an entry"
case result of
Nothing ->
Expand All @@ -453,9 +453,9 @@ prop_selectRandom_one_withAsset u a = checkCoverage $ monadicIO $ do
prop_selectRandom_one_withAssetOnly :: UTxOIndex -> AssetId -> Property
prop_selectRandom_one_withAssetOnly u a = checkCoverage $ monadicIO $ do
result <- run $ UTxOIndex.selectRandom u (WithAssetOnly a)
monitor $ cover 80 (a `Set.member` UTxOIndex.assets u)
monitor $ cover 70 (a `Set.member` UTxOIndex.assets u)
"index has the specified asset"
monitor $ cover 80 (Set.size (UTxOIndex.assets u) > 1)
monitor $ cover 70 (Set.size (UTxOIndex.assets u) > 1)
"index has more than one asset"
monitor $ cover 20 (isJust result)
"selected an entry"
Expand Down Expand Up @@ -491,7 +491,7 @@ prop_selectRandom_all_any u = checkCoverage $ monadicIO $ do
prop_selectRandom_all_withAdaOnly :: UTxOIndex -> Property
prop_selectRandom_all_withAdaOnly u = checkCoverage $ monadicIO $ do
(selectedEntries, u') <- run $ selectAll WithAdaOnly u
monitor $ cover 80 (not (null selectedEntries))
monitor $ cover 70 (not (null selectedEntries))
"selected at least one entry"
assert $ L.all (\(_, o) -> not (txOutIsAdaOnly o)) (UTxOIndex.toList u')
assert $ L.all (\(_, o) -> txOutIsAdaOnly o) selectedEntries
Expand All @@ -503,11 +503,11 @@ prop_selectRandom_all_withAdaOnly u = checkCoverage $ monadicIO $ do
prop_selectRandom_all_withAsset :: UTxOIndex -> AssetId -> Property
prop_selectRandom_all_withAsset u a = checkCoverage $ monadicIO $ do
(selectedEntries, u') <- run $ selectAll (WithAsset a) u
monitor $ cover 80 (a `Set.member` UTxOIndex.assets u)
monitor $ cover 70 (a `Set.member` UTxOIndex.assets u)
"index has the specified asset"
monitor $ cover 80 (Set.size (UTxOIndex.assets u) > 1)
monitor $ cover 70 (Set.size (UTxOIndex.assets u) > 1)
"index has more than one asset"
monitor $ cover 80 (not (null selectedEntries))
monitor $ cover 70 (not (null selectedEntries))
"selected at least one entry"
assert $ L.all (\(_, o) -> not (txOutHasAsset o a)) (UTxOIndex.toList u')
assert $ L.all (\(_, o) -> txOutHasAsset o a) selectedEntries
Expand All @@ -520,9 +520,9 @@ prop_selectRandom_all_withAsset u a = checkCoverage $ monadicIO $ do
prop_selectRandom_all_withAssetOnly :: UTxOIndex -> AssetId -> Property
prop_selectRandom_all_withAssetOnly u a = checkCoverage $ monadicIO $ do
(selectedEntries, u') <- run $ selectAll (WithAssetOnly a) u
monitor $ cover 80 (a `Set.member` UTxOIndex.assets u)
monitor $ cover 70 (a `Set.member` UTxOIndex.assets u)
"index has the specified asset"
monitor $ cover 80 (Set.size (UTxOIndex.assets u) > 1)
monitor $ cover 70 (Set.size (UTxOIndex.assets u) > 1)
"index has more than one asset"
monitor $ cover 20 (not (null selectedEntries))
"selected at least one entry"
Expand Down

0 comments on commit 7acc8ac

Please sign in to comment.