diff --git a/deque.cabal b/deque.cabal
--- a/deque.cabal
+++ b/deque.cabal
@@ -1,45 +1,44 @@
-name:
-  deque
-version:
-  0.2.5
-synopsis:
-  Double-ended queue
+name: deque
+version: 0.2.6
+synopsis: Double-ended queue
 description:
   An implementation of Double-Ended Queue (aka Dequeue or Deque)
   based on the head-tail linked list.
-homepage:
-  https://github.com/nikita-volkov/deque
-bug-reports:
-  https://github.com/nikita-volkov/deque/issues
-author:
-  Nikita Volkov <nikita.y.volkov@mail.ru>
-maintainer:
-  Nikita Volkov <nikita.y.volkov@mail.ru>
-copyright:
-  (c) 2016, Nikita Volkov
-license:
-  MIT
-license-file:
-  LICENSE
-build-type:
-  Simple
-cabal-version:
-  >=1.10
+homepage: https://github.com/nikita-volkov/deque
+bug-reports: https://github.com/nikita-volkov/deque/issues
+author: Nikita Volkov <nikita.y.volkov@mail.ru>
+maintainer: Nikita Volkov <nikita.y.volkov@mail.ru>
+copyright: (c) 2016, Nikita Volkov
+license: MIT
+license-file: LICENSE
+build-type: Simple
+cabal-version: >=1.10
 
 source-repository head
-  type:
-    git
-  location:
-    git://github.com/nikita-volkov/deque.git
+  type: git
+  location: git://github.com/nikita-volkov/deque.git
 
 library
-  hs-source-dirs:
-    library
-  default-extensions:
-    DeriveFunctor, StandaloneDeriving
-  default-language:
-    Haskell2010
+  hs-source-dirs: library
+  default-extensions: DeriveFunctor, ScopedTypeVariables, StandaloneDeriving
+  default-language: Haskell2010
   exposed-modules:
     Deque
   build-depends:
     base >= 4.9 && < 5
+
+test-suite test
+  type: exitcode-stdio-1.0
+  hs-source-dirs: test
+  default-extensions: DeriveFunctor, ScopedTypeVariables, StandaloneDeriving
+  default-language: Haskell2010
+  main-is:
+    Main.hs
+  build-depends:
+    deque,
+    QuickCheck >=2.8.1 && <3,
+    quickcheck-instances >=0.3.11 && <0.4,
+    rerebase <2,
+    tasty >=0.12 && <2,
+    tasty-hunit >=0.9 && <0.11,
+    tasty-quickcheck >=0.9 && <0.11
diff --git a/library/Deque.hs b/library/Deque.hs
--- a/library/Deque.hs
+++ b/library/Deque.hs
@@ -30,9 +30,24 @@
 takeWhile :: (a -> Bool) -> Deque a -> Deque a
 takeWhile predicate (Deque snocList consList) =
   let
-    newConsList = List.takeWhile predicate consList
-    newSnocList = List.takeWhile (not . predicate) snocList
-    in Deque newSnocList newConsList
+    newConsList = List.foldr
+      (\ a nextState -> if predicate a
+        then a : nextState
+        else [])
+      (List.takeWhile predicate (List.reverse snocList))
+      consList
+    in Deque [] newConsList
+
+-- |
+-- /O(n)/.
+-- Drop the first elements satisfying the predicate.
+dropWhile :: (a -> Bool) -> Deque a -> Deque a
+dropWhile predicate (Deque snocList consList) =
+  let
+    newConsList = List.dropWhile predicate consList
+    in case newConsList of
+      [] -> Deque [] (List.dropWhile predicate (List.reverse snocList))
+      _ -> Deque snocList newConsList
 
 -- |
 -- /O(1)/, occasionally /O(n)/.
diff --git a/test/Main.hs b/test/Main.hs
new file mode 100644
--- /dev/null
+++ b/test/Main.hs
@@ -0,0 +1,34 @@
+module Main where
+
+import Prelude
+import Test.QuickCheck.Instances
+import Test.Tasty
+import Test.Tasty.Runners
+import Test.Tasty.HUnit
+import Test.Tasty.QuickCheck
+import qualified Test.QuickCheck as QuickCheck
+import qualified Test.QuickCheck.Property as QuickCheck
+import qualified Deque as Deque
+import qualified Data.List as List
+
+
+main =
+  defaultMain $
+  testGroup "List roundtrips" $ let
+  testPredicateProperty name listOp dequeOp =
+    testProperty name $ \ (list1 :: [Int], list2 :: [Int], threshold :: Int, direction :: Int) -> let
+      compare = case mod direction 5 of
+        0 -> (>)
+        1 -> (>=)
+        2 -> (==)
+        3 -> (<=)
+        4 -> (<)
+      predicate = compare threshold
+      in
+        listOp predicate (list1 <> list2) ===
+        toList (dequeOp predicate (Deque.Deque (reverse list2) list1))
+    in [
+        testPredicateProperty "takeWhile" List.takeWhile Deque.takeWhile
+        ,
+        testPredicateProperty "dropWhile" List.dropWhile Deque.dropWhile
+      ]
