diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,7 @@
 # Changelog
 
+* **1.4.0.0**
+  - Use data files for test fixtures, fixing Nixpkgs test problem
 * **1.3.0.0**
   - "Snippet mode" and "range mode" can no longer be used together
   - Using the `numberLines` class sets the `startFrom` attribute for correct
diff --git a/pandoc-include-code.cabal b/pandoc-include-code.cabal
--- a/pandoc-include-code.cabal
+++ b/pandoc-include-code.cabal
@@ -7,15 +7,21 @@
   together with preformatted HTML-like sources, in Pandoc.
 author:              Oskar Wickström
 maintainer:          Oskar Wickström
-homepage:	     https://github.com/owickstrom/pandoc-include-code
-version:             1.3.0.0
+homepage:	           https://github.com/owickstrom/pandoc-include-code
+version:             1.4.0.0
 cabal-version:       >= 1.8
 build-type:          Simple
 category:            Documentation
 license:             MPL-2.0
 license-file:        LICENSE
 extra-source-files:  CHANGELOG.md
+data-files:
+  test/fixtures/foo-snippet.txt
+  test/fixtures/foo-snippets.txt
+  test/fixtures/indents.txt
+  test/fixtures/some-text.txt
 
+
 source-repository head
   type:     git
   location: git://github.com/owickstrom/pandoc-include-code.git
@@ -28,7 +34,7 @@
                    , unordered-containers >= 0.2      && < 0.3
                    , process
                    , filepath
-                   , text                 >= 1.2      && < 1.3
+                   , text                 >= 1.2      && < 2
                    , mtl                  >= 2.2      && < 3
                    , pandoc-types         >= 1.12     && <= 1.19
 
@@ -44,6 +50,7 @@
     type:            exitcode-stdio-1.0
     hs-source-dirs:  test
     other-modules:   FilterTest
+                   , Paths_pandoc_include_code
     main-is:         Driver.hs
     build-depends:   base                 >= 4        && < 5
                    , pandoc-types         >= 1.12     && <= 1.19
diff --git a/test/Driver.hs b/test/Driver.hs
--- a/test/Driver.hs
+++ b/test/Driver.hs
@@ -1,7 +1,6 @@
 module Main where
 
-import Test.Tasty
-import Test.Tasty.HUnit
+import           Test.Tasty
 
 import qualified FilterTest
 
diff --git a/test/FilterTest.hs b/test/FilterTest.hs
--- a/test/FilterTest.hs
+++ b/test/FilterTest.hs
@@ -1,14 +1,16 @@
-{-# LANGUAGE LambdaCase #-}
+{-# LANGUAGE LambdaCase    #-}
 {-# LANGUAGE TupleSections #-}
 
 module FilterTest where
 
-import Test.Tasty
-import Test.Tasty.HUnit
+import           Test.Tasty
+import           Test.Tasty.HUnit
 
 import qualified Text.Pandoc.Filter.IncludeCode as Filter
-import Text.Pandoc.JSON
+import           Text.Pandoc.JSON
 
+import           Paths_pandoc_include_code
+
 fails a =
   a >>= \case
     Left _ -> return ()
@@ -25,12 +27,13 @@
   -> [String]
   -> [(String, String)]
   -> IO (Either Filter.InclusionError Block)
-includeCode fixtureName classes attrs =
+includeCode fixtureName classes attrs = do
+  fname <- getDataFileName ("test/fixtures/" ++ fixtureName)
   Filter.includeCode'
     (CodeBlock
        ( ""
        , classes
-       , mconcat [[("include", "test/fixtures/" ++ fixtureName)], attrs])
+       , mconcat [[("include", fname)], attrs])
        "")
 
 noRange = (Nothing, Nothing)
diff --git a/test/fixtures/foo-snippet.txt b/test/fixtures/foo-snippet.txt
new file mode 100644
--- /dev/null
+++ b/test/fixtures/foo-snippet.txt
@@ -0,0 +1,3 @@
+start snippet foo
+foo
+end snippet foo
diff --git a/test/fixtures/foo-snippets.txt b/test/fixtures/foo-snippets.txt
new file mode 100644
--- /dev/null
+++ b/test/fixtures/foo-snippets.txt
@@ -0,0 +1,9 @@
+// start snippet foo-other
+foo-other
+// end snippet foo-other
+
+// (note the spaces after "foo" below, they are ok)
+
+// start snippet foo
+foo
+// end snippet foo
diff --git a/test/fixtures/indents.txt b/test/fixtures/indents.txt
new file mode 100644
--- /dev/null
+++ b/test/fixtures/indents.txt
@@ -0,0 +1,5 @@
+zero
+  two
+ one
+   three
+        eight
diff --git a/test/fixtures/some-text.txt b/test/fixtures/some-text.txt
new file mode 100644
--- /dev/null
+++ b/test/fixtures/some-text.txt
@@ -0,0 +1,5 @@
+hello
+world
+this
+is
+text
