mirror of
https://github.com/facebook/Haxl.git
synced 2024-12-23 08:43:16 +03:00
4400409acb
Summary: This diff removes the scuba field as described in the task, as well as removing numRounds from Stats. This involved removing the numRounds assertion from expectRounds* functions, which I chose to rename to expectResult* (lmk if you prefer something different there). Within Stats, I merely deleted the numRounds function. I didn't go looking for anything deeper to clean up because it looked like `rs` was used in other functions. Reviewed By: zilberstein Differential Revision: D8963298 fbshipit-source-id: d367b53007be03bd290222c676539680acd9f929
56 lines
1.1 KiB
Haskell
56 lines
1.1 KiB
Haskell
-- Copyright (c) 2014-present, Facebook, Inc.
|
|
-- All rights reserved.
|
|
--
|
|
-- This source code is distributed under the terms of a BSD license,
|
|
-- found in the LICENSE file.
|
|
|
|
{-# LANGUAGE RebindableSyntax, OverloadedStrings, ApplicativeDo #-}
|
|
module AdoTests (tests) where
|
|
|
|
import TestUtils
|
|
import MockTAO
|
|
|
|
import Control.Applicative
|
|
import Test.HUnit
|
|
|
|
import Prelude()
|
|
import Haxl.Prelude
|
|
|
|
-- -----------------------------------------------------------------------------
|
|
|
|
--
|
|
-- Test ApplicativeDo batching
|
|
--
|
|
ado1 = expectResult 12 ado1_
|
|
|
|
ado1_ = do
|
|
a <- friendsOf =<< id1
|
|
b <- friendsOf =<< id2
|
|
return (length (a ++ b))
|
|
|
|
ado2 = expectResult 12 ado2_
|
|
|
|
ado2_ = do
|
|
x <- id1
|
|
a <- friendsOf x
|
|
y <- id2
|
|
b <- friendsOf y
|
|
return (length (a ++ b))
|
|
|
|
ado3 = expectResult 11 ado3_
|
|
|
|
ado3_ = do
|
|
x <- id1
|
|
a <- friendsOf x
|
|
a' <- friendsOf =<< if null a then id3 else id4
|
|
y <- id2
|
|
b <- friendsOf y
|
|
b' <- friendsOf =<< if null b then id4 else id3
|
|
return (length (a' ++ b'))
|
|
|
|
tests future = TestList
|
|
[ TestLabel "ado1" $ TestCase (ado1 future)
|
|
, TestLabel "ado2" $ TestCase (ado2 future)
|
|
, TestLabel "ado3" $ TestCase (ado3 future)
|
|
]
|