Specs for recovering intervals from the log now pass.

[?]
May 6, 2015, 1:58 PM
4SCFOJGNDAN4XZEAPWQQCBJ3CGZCJP3HUADRQLYZ2ITAKA7EJJTQC

Dependencies

  • [2] KNSI575V Cleanup of EventLog types.
  • [3] 7KZP4RHZ Switch from Data.Time to Data.Thyme
  • [4] OBFPJS2G Project successfully builds and tests under nix.
  • [5] SCXG6TJW Make log reduction safer in presence of overlapping events.
  • [6] 64C6AWH6 Rename Ananke -> Quixotic, project reboot.
  • [7] A6HKMINB Attempting to improve JSON handling.
  • [8] NVOCQVAS Initial failing tests.
  • [9] NMWWP4ZN Trying out Hspec
  • [10] EMVTF2IW WIP moving back to snap.
  • [11] EQXRXRZD Changed to use tasty instead of test-framework
  • [12] 5DRIWGLU Improving TimeLog specs
  • [13] N4NDAZYT Initial implementation of payouts.

Change contents

  • replacement in lib/Quixotic/Interval.hs at line 4
    [3.5263][3.3:54]()
    ( Interval(Interval), interval, start, end, ilen
    [3.5263]
    [3.3192]
    ( Interval(..), interval, start, end, ilen
  • replacement in test/Quixotic/TimeLogSpec.hs at line 34
    [2.3596][2.3596:3629]()
    buildIntervals t (d : s : dx) =
    [2.3596]
    [2.3629]
    buildIntervals t (d : s : dx) | d > 0 =
  • replacement in test/Quixotic/TimeLogSpec.hs at line 36
    [2.3666][2.3666:3723]()
    in ival : buildIntervals (ival ^. end .+^ (abs s)) dx
    [2.3666]
    [2.3723]
    in ival : buildIntervals (ival ^. end .+^ s) dx
  • replacement in test/Quixotic/TimeLogSpec.hs at line 42
    [2.3828][2.3828:3879]()
    let deltas = filter (> 0) <$> listOf arbitrary
    [2.3828]
    [2.3879]
    let deltas = fmap T.fromSeconds <$> ((listOf $ choose (0, 72 * 60 * 60)) :: Gen[Int])
  • replacement in test/Quixotic/TimeLogSpec.hs at line 88
    [3.1964][2.4335:4441]()
    let ivalEntries addr ival = LogEntry addr <$> [StartWork (ival ^. start), StopWork (ival ^. end)]
    [3.1964]
    [2.4441]
    let mergeAdjacent ((Interval s e) : (Interval s' e') : xs) | e == s' = mergeAdjacent $ Interval s e' : xs
    mergeAdjacent (x : xs) = x : mergeAdjacent xs
    mergeAdjacent [] = []
    ivalEntries addr ival = LogEntry addr <$> [StartWork (ival ^. start), StopWork (ival ^. end)]
  • edit in test/Quixotic/TimeLogSpec.hs at line 96
    [3.3717]
    [2.4506]
    widx' = fmap (L.fromList . mergeAdjacent . sortOn _start . L.toList) widx
  • replacement in test/Quixotic/TimeLogSpec.hs at line 99
    [2.4558][3.2015:2104](),[3.2015][3.2015:2104]()
    in workIndex logEntries `shouldBe` (WorkIndex $ fmap (L.reverse . L.sort) widx)
    [2.4558]
    [3.3975]
    in workIndex logEntries `shouldBe` (WorkIndex $ fmap (L.reverse . L.sort) widx')
  • edit in test/Quixotic/TimeLogSpec.hs at line 103
    [3.1712][3.975:977](),[3.975][3.975:977](),[3.977][3.3833:4486]()
    {--
    (fromList [
    (BtcAddr "S\187\156\a\SOx\229`[\133a%7o%'XBt\249\226\n\ENQ\SOH\GS<\241WU5{Si\251",
    [ Interval {_start = 1858-11-16 23:59:59.999997 UTC, _end = 1858-11-16 23:59:59.999997 UTC}
    , Interval {_start = 1858-11-16 23:59:59.999998 UTC, _end = 1858-11-17 00:00:00.000002 UTC}]),
    (BtcAddr "\138;\GS\132U0\SUB\ESCf[\NAKo`\ACKR[\EMq\b\v\159\184u\ACK&jS#n#?\SI&v",
    [Interval {_start = 1858-11-16 23:59:59.999999 UTC, _end = 1858-11-17 00:00:00 UTC}
    ,Interval {_start = 1858-11-17 00:00:00.000002 UTC, _end = 1858-11-17 00:00:00.000006 UTC}
    ,Interval {_start = 1858-11-16 23:59:59.999994 UTC, _end = 1858-11-16 23:59:59.999998 UTC}])
    ])
    -}