Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/src/libraries/fps/tests/Units.hs

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


--
-- Must have rules off to avoid them making it look lazy when it isn't really
--

import Control.Monad
import System.Exit
import Test.HUnit

import qualified Data.ByteString.Lazy as L

------------------------------------------------------------------------
-- The entry point

main :: IO ()
main = do counts <- runTestTT tests
          when ((errors counts, failures counts) /= (0, 0)) $
              exitWith (ExitFailure 1)

tests :: Test
tests = TestList [append_tests]

append_tests :: Test
append_tests = TestLabel "append" $ TestList [
    TestLabel "lazy tail" $ TestCase $
        L.head (L.pack [38] `L.append` error "Tail should be lazy") @=? 38
   ]


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.