Specs for recovering intervals from the log now pass.
[?]
May 6, 2015, 1:58 PM
4SCFOJGNDAN4XZEAPWQQCBJ3CGZCJP3HUADRQLYZ2ITAKA7EJJTQCDependencies
- [2]
KNSI575VCleanup of EventLog types. - [3]
7KZP4RHZSwitch from Data.Time to Data.Thyme - [4]
OBFPJS2GProject successfully builds and tests under nix. - [5]
SCXG6TJWMake log reduction safer in presence of overlapping events. - [6]
64C6AWH6Rename Ananke -> Quixotic, project reboot. - [7]
A6HKMINBAttempting to improve JSON handling. - [8]
NVOCQVASInitial failing tests. - [9]
NMWWP4ZNTrying out Hspec - [10]
EMVTF2IWWIP moving back to snap. - [11]
EQXRXRZDChanged to use tasty instead of test-framework - [12]
5DRIWGLUImproving TimeLog specs - [13]
N4NDAZYTInitial implementation of payouts.
Change contents
- replacement in lib/Quixotic/Interval.hs at line 4
( Interval(Interval), interval, start, end, ilen( Interval(..), interval, start, end, ilen - replacement in test/Quixotic/TimeLogSpec.hs at line 34
buildIntervals t (d : s : dx) =buildIntervals t (d : s : dx) | d > 0 = - replacement in test/Quixotic/TimeLogSpec.hs at line 36
in ival : buildIntervals (ival ^. end .+^ (abs s)) dxin ival : buildIntervals (ival ^. end .+^ s) dx - replacement in test/Quixotic/TimeLogSpec.hs at line 42
let deltas = filter (> 0) <$> listOf arbitrarylet deltas = fmap T.fromSeconds <$> ((listOf $ choose (0, 72 * 60 * 60)) :: Gen[Int]) - replacement in test/Quixotic/TimeLogSpec.hs at line 88
let ivalEntries addr ival = LogEntry addr <$> [StartWork (ival ^. start), StopWork (ival ^. end)]let mergeAdjacent ((Interval s e) : (Interval s' e') : xs) | e == s' = mergeAdjacent $ Interval s e' : xsmergeAdjacent (x : xs) = x : mergeAdjacent xsmergeAdjacent [] = []ivalEntries addr ival = LogEntry addr <$> [StartWork (ival ^. start), StopWork (ival ^. end)] - edit in test/Quixotic/TimeLogSpec.hs at line 96
widx' = fmap (L.fromList . mergeAdjacent . sortOn _start . L.toList) widx - replacement in test/Quixotic/TimeLogSpec.hs at line 99
in workIndex logEntries `shouldBe` (WorkIndex $ fmap (L.reverse . L.sort) widx)in workIndex logEntries `shouldBe` (WorkIndex $ fmap (L.reverse . L.sort) widx') - edit in test/Quixotic/TimeLogSpec.hs at line 103
{--(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}])])-}