Skip to content

Commit 87ebffa

Browse files
committed
tests for fromLitInteger
1 parent 5bac463 commit 87ebffa

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

test/TreeTest.hs

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -262,14 +262,20 @@ RT.B :: Pair (RTree n a) -> RTree (S n) a
262262
inTest :: String -> IO ()
263263
inTest cmd = systemSuccess ("cd ../test; " ++ cmd) -- (I run ghci in ../src)
264264

265+
mk :: String -> IO ()
266+
mk s = inTest ("make " ++ s)
267+
265268
doit :: IO ()
266-
doit = inTest "make doit"
269+
doit = mk "doit"
267270

268271
reify :: IO ()
269-
reify = inTest "make reify"
272+
reify = mk "reify"
273+
274+
reifyDone :: IO ()
275+
reifyDone = mk "reify-done"
270276

271277
noReify :: IO ()
272-
noReify = inTest "make no-reify"
278+
noReify = mk "no-reify"
273279

274280
make :: IO ()
275281
make = systemSuccess "cd ../..; make"
@@ -310,7 +316,7 @@ fft_r2_dit' Zero = id
310316
fft_r2_dit' (Succ n) = RT.toB . P.inP (uncurry (+) &&& uncurry (-)) . P.secondP (liftA2 (*) (phasor n)) . fmap (fft_r2_dit' n) . RT.bottomSplit
311317

312318
-- main = go "fft_r2_dit" (fft_r2_dit :: RTree N1 (Complex Int) -> RTree N1 (Complex Int))
313-
main = go "fft_r2_dit" (fft_r2_dit :: RTree N2 (Complex Double) -> RTree N2 (Complex Double))
319+
-- main = go "fft_r2_dit" (fft_r2_dit :: RTree N2 (Complex Double) -> RTree N2 (Complex Double))
314320
-- main = go "fft_r2_dit" (fft_r2_dit :: RTree N1 (Complex PrettyDouble) -> RTree N1 (Complex PrettyDouble))
315321
-- main = go "fft_r2_dit" (fft_r2_dit :: RTree N2 (Complex Int) -> RTree N2 (Complex Int))
316322
-- main = goSep "fft_r2_dit" 1 (fft_r2_dit :: RTree N1 (Complex Int) -> RTree N1 (Complex Int))
@@ -416,7 +422,7 @@ main = go "fft_r2_dit" (fft_r2_dit :: RTree N2 (Complex Double) -> RTree N2 (Com
416422

417423
-- main = go "dot-22" ((\ ((a,b),(c,d)) -> a*c + b*d) :: ((Int,Int),(Int,Int)) -> Int)
418424

419-
-- main = go "tdot-4" (dot :: RTree N4 (Int,Int) -> Int)
425+
-- main = go "tdot-2" (dot :: RTree N2 (Int,Int) -> Int)
420426

421427
-- main = go "tpdot-4" (dot'' :: RTree N4 (Pair Int) -> Int)
422428

@@ -425,7 +431,7 @@ main = go "fft_r2_dit" (fft_r2_dit :: RTree N2 (Complex Double) -> RTree N2 (Com
425431

426432
-- main = go "prod1" (prod :: RTree N1 (Int,Int) -> RTree N1 Int)
427433

428-
-- main = go "dot5" (dot :: RTree N5 (Int,Int) -> Int)
434+
-- main = go "dot3" (dot :: RTree N3 (Int,Int) -> Int)
429435

430436
-- main = go "squares2" (squares :: Unop (RTree N2 Int))
431437

@@ -510,7 +516,9 @@ main = go "fft_r2_dit" (fft_r2_dit :: RTree N2 (Complex Double) -> RTree N2 (Com
510516

511517
-- main = go "lsums-v5" (lsums :: Vec N5 Int -> (Vec N5 Int, Int))
512518

513-
-- main = go "lsums-rt2" (lsums :: RTree N2 Int -> (RTree N2 Int, Int))
519+
main = go "lsums-rt2" (lsums :: RTree N2 Int -> (RTree N2 Int, Int))
520+
521+
-- main = go "foo" (0 :: Int)
514522

515523
-- main = go "lsums-lt2" (lsums :: LTree N2 Int -> (LTree N2 Int, Int))
516524

@@ -1664,14 +1672,19 @@ foldMap' f = foldl (\ m a -> mappend (f a) m) mempty
16641672

16651673
-- main = go "foo" ((+) :: Binop Int)
16661674

1667-
-- phasor :: (IsNat n, RealFloat a, Enum a) => Nat n -> RTree n (Complex a)
1668-
-- phasor n = scanlTEx (*) 1 (pure phaseDelta)
1669-
-- where phaseDelta = cis ((-pi) / 2 ** natToZ n)
1670-
1671-
-- main = go "foo" (phasor (nat :: Nat N1))
1672-
16731675
-- main = go "foo" (1 :: Complex Double)
16741676

16751677
-- main = go "foo" (fromInteger 1 :: Double)
16761678

1679+
-- main = go "foo" (fromInteger 1 :: PrettyDouble)
1680+
16771681
-- main = go "foo" (fromIntegral :: Int -> Double)
1682+
1683+
-- phasor :: (IsNat n, RealFloat a, Enum a) => Nat n -> RTree n (Complex a)
1684+
-- phasor n = scanlTEx (*) 1 (pure phaseDelta)
1685+
-- where
1686+
-- phaseDelta = cis ((-pi) / (2 ** natToZ n))
1687+
1688+
-- main = go "foo" (phasor (nat :: Nat N1))
1689+
1690+
-- main = go "foo" (natToZ (nat :: Nat N1) :: Int)

0 commit comments

Comments
 (0)