Skip to content

Commit 7f6b26f

Browse files
committed
fix UT
1 parent 89e0416 commit 7f6b26f

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

app/Main.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,9 @@ runRootFinderBy (RootFinderReq req@(dt,Just assumps,nonPerfAssump@AP.NonPerfAssu
426426
def = RiddersParam { riddersMaxIter = itertimes, riddersTol = RelTol 0.000001}
427427
riddersFn = case tweak of
428428
SplitFixedBalance _ _ (l,h) -> ridders def (min h 0.99, max l 0.00001)
429-
StressPoolDefault (l,h) -> ridders def (h ,max l 0.00)
430-
StressPoolPrepayment (l,h) -> ridders def (h ,max l 0.00)
431-
MaxSpreadTo _ (l,h) -> ridders def (h ,max l 0.00)
429+
StressPoolDefault (l,h) -> ridders def (h ,max l 0.00)
430+
StressPoolPrepayment (l,h) -> ridders def (h ,max l 0.00)
431+
MaxSpreadTo _ (l,h) -> ridders def (h ,max l 0.00)
432432
in
433433
case riddersFn (rootFindAlgo req tweak stop) of
434434
Root r -> return $ RFResult r (doTweak r tweak req)

src/Deal/DealRun.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
module Deal.DealRun (
44
run
5+
,accrueRC
56
) where
67

78
import qualified Data.Set as S
@@ -296,8 +297,6 @@ appendCollectedCF d t@TestDeal { pool = pt } poolInflowMap
296297
t {pool = newPt} -- `debug` ("after insert bal"++ show newPt)
297298

298299

299-
300-
301300
run :: Ast.Asset a => TestDeal a -> Map.Map PoolId CF.PoolCashflow -> Maybe [ActionOnDate] -> Maybe [RateAssumption] -> Maybe ([Pre],[Pre])
302301
-> Maybe (Map.Map String (RevolvingPool,AP.ApplyAssumptionType)) -> DL.DList ResultComponent
303302
-> Either String (TestDeal a, DL.DList ResultComponent, Map.Map PoolId CF.PoolCashflow)

test/DealTest/ResecDealTest.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ resecDeal = D.TestDeal {
121121
]
122122
)
123123
,D.pool = D.ResecDeal (Map.fromList [(DealBondFlow "base case" "A" (toDate "20200101") 0.25
124-
, D.UnderlyingDeal baseCase CF.emptyCashflow CF.emptyCashflow Nothing)])
124+
, D.UnderlyingDeal baseCase (Just CF.emptyCashflow) (Just CF.emptyCashflow) Nothing)])
125125
,D.waterfall = Map.fromList [(W.DistributionDay Amortizing, [
126126
(W.PayInt Nothing "General" ["A"] Nothing)
127127
,(W.PayPrin Nothing "General" ["A"] Nothing)

test/UT/AssetTest.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,11 +641,11 @@ delinqScheduleCFTest =
641641
,A.DummyDefaultAssump))
642642

643643
poolCf = fst . head $
644-
case D.runPool pool assump1 Nothing of
644+
case P.runPool pool assump1 Nothing of
645645
Left errorMsg -> undefined `debug` ("Error in pool run"++show errorMsg)
646646
Right x -> x `debug` ("pool run resp"++show x)
647647
poolCf2 = fst . head $
648-
case D.runPool pool assump2 Nothing of
648+
case P.runPool pool assump2 Nothing of
649649
Left _ -> undefined
650650
Right x -> x
651651
in

test/UT/RateHedgeTest.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Lib
99
import Types
1010
import Util
1111
import Stmt
12-
import Deal (accrueRC)
12+
import Deal.DealRun (accrueRC)
1313
import Data.Ratio
1414
import UT.DealTest (td2)
1515
import Hedge (RateSwap(..),RateCap(..),RateSwapBase(..),rcNetCash)

0 commit comments

Comments
 (0)