Fix out-of-date test code, add skeleton for payments spec.
[?]
Feb 22, 2017, 8:43 PM
3GBSDS5PDSTTJTJOLEKZRRTAONS3T3JFZ3FQGFGS3AOXDBZ6SPLACDependencies
- [2]
DFOBMSAOInitial work on payments API - [3]
LHJ2HFXVAdd property test for auction algorithm. - [4]
SCXG6TJWMake log reduction safer in presence of overlapping events. - [5]
FD7SV5I6Fix handling of event_t columns. - [6]
NEDDHXUKReformat via stylish-haskell - [7]
RSEB2NFGReplacing Snap with Scotty. - [8]
5DRIWGLUImproving TimeLog specs - [9]
KNSI575VCleanup of EventLog types. - [10]
OBFPJS2GProject successfully builds and tests under nix. - [11]
7KZP4RHZSwitch from Data.Time to Data.Thyme - [12]
EQXRXRZDChanged to use tasty instead of test-framework - [13]
OV5AKJHARemove unused LogInterval type. - [14]
HBULCDN6Add tests for auction winner determination algorithm. - [15]
NMWWP4ZNTrying out Hspec - [16]
JV3UEPNCFix Aeson constructors. - [17]
NVOCQVASInitial failing tests. - [18]
Y35QCWYWMinor improvement in WorkIndex type to eliminate duplicated information. - [19]
UUR6SMCAAdd start of specs for auctions. - [20]
2KZPOGRBOnce you get Haskell to compile, the tests pass! - [*]
64C6AWH6Rename Ananke -> Quixotic, project reboot. - [*]
WO2MINIFAuctions now compile! - [*]
4U7F3CPITHE GREAT RENAMING OF THINGS!
Change contents
- edit in aftok.cabal at line 89
other-modules: Aftok.AuctionSpec, Aftok.Generators, Aftok.PaymentsSpec, Aftok.TimeLogSpec, Aftok.Util.HttpSpec - edit in aftok.cabal at line 105
, haskoin-core - edit in test/Aftok/AuctionSpec.hs at line 1
{-# OPTIONS_GHC -Wwarn -fno-warn-orphans #-} - edit in test/Aftok/AuctionSpec.hs at line 4
import Aftokimport Aftok.Auctionimport Aftok.Types - edit in test/Aftok/AuctionSpec.hs at line 10
import Aftokimport Aftok.Auctionimport Aftok.Generatorsimport Aftok.Types - edit in test/Aftok/AuctionSpec.hs at line 20
uuidGen :: Gen UUIDuuidGen = fromWords <$> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary - edit in test/Aftok/AuctionSpec.hs at line 21
genSatoshi :: Gen SatoshigenSatoshi = Satoshi <$> arbitrary - replacement in test/Aftok/AuctionSpec.hs at line 22
genBid = Bid <$> (UserId <$> uuidGen)genBid = Bid <$> (UserId <$> genUUID) - replacement in test/Aftok/AuctionSpec.hs at line 53
InsufficientBids t ->InsufficientBids _ -> - file addition: Generators.hs[24.3462]
module Aftok.Generators whereimport ClassyPreludeimport Data.UUIDimport Network.Haskoin.Test (ArbitraryAddress(..))import Aftok (BtcAddr(..))import Aftok.Types (Satoshi(..))import Test.QuickCheckgenUUID :: Gen UUIDgenUUID = fromWords <$> arbitrary <*> arbitrary <*> arbitrary <*> arbitrarygenSatoshi :: Gen SatoshigenSatoshi = Satoshi <$> arbitrarygenBtcAddr :: Gen BtcAddrgenBtcAddr = fmap (\(ArbitraryAddress addr) -> BtcAddr addr) arbitrary - file addition: PaymentsSpec.hs[24.3462]
{-# OPTIONS_GHC -Wwarn -fno-warn-orphans #-}module Aftok.PaymentsSpec (main, spec) whereimport ClassyPreludeimport Test.Hspecspec :: Specspec = dodescribe "finding unbilled dates" $ dopure ()--it "returns the billing date in the presence of an expired payment request" $-- forAll ((,) <$> genSatoshi <*> listOf genBid) $-- \(raiseAmount', bids) ->-- case runAuction' raiseAmount' bids of-- WinningBids xs -> bidsTotal xs == raiseAmount'-- InsufficientBids t -> t == (raiseAmount' - bidsTotal bids)main :: IO ()main = hspec spec - edit in test/Aftok/TimeLogSpec.hs at line 18
import Aftok.Generators - edit in test/Aftok/TimeLogSpec.hs at line 24[3.1906]→[3.3279:3280](∅→∅),[3.12560]→[3.3279:3280](∅→∅),[3.3279]→[3.3279:3280](∅→∅),[3.3280]→[3.2106:2188](∅→∅)
genBtcAddr :: Gen BtcAddrgenBtcAddr =BtcAddr . pack <$> vectorOf 34 arbitrary - replacement in test/Aftok/TimeLogSpec.hs at line 49
pure (addr, ivals)pure (CreditToAddress addr, ivals) - replacement in test/Aftok/TimeLogSpec.hs at line 69
testIntervals :: [(BtcAddr, Interval)]testIntervals :: [(CreditTo, Interval)] - replacement in test/Aftok/TimeLogSpec.hs at line 73
pure $ (addr, I.interval start' end')pure $ (CreditToAddress addr, I.interval start' end')