Commits

Bryan O'Sullivan  committed dab39a8

Test useAsPtr and fromPtr

  • Participants
  • Parent commits 1bfe6fd

Comments (0)

Files changed (1)

File tests/Properties.hs

 t_takeWord16 m t = takeWord16 m t `T.isPrefixOf` t
 t_take_drop_16 m t = T.append (takeWord16 n t) (dropWord16 n t) == t
   where n = small m
+t_use_from t = monadicIO $ assert . (==t) =<< run (useAsPtr t fromPtr)
 
 -- Regression tests.
 s_filter_eq s = S.filter p t == S.streamList (filter p s)
   testGroup "lowlevel" [
     testProperty "t_dropWord16" t_dropWord16,
     testProperty "t_takeWord16" t_takeWord16,
-    testProperty "t_take_drop_16" t_take_drop_16
+    testProperty "t_take_drop_16" t_take_drop_16,
+    testProperty "t_use_from" t_use_from
   ]
  ]