<p>To run <code>doctest</code>, you don't need to add that to your cabal file. You need to install the <code>doctest</code> executable, and then run <code>cabal repl --with-ghc=doctest</code>. See the <a href="https://github.com/sol/doctest" rel="nofollow noreferrer">doctest documentation</a>.</p>

CC BY-SA 4.0
2022-01-19T03:18:00.317Z
IIUC, I can only use things that are installed with Nix in this project. How do I find and install the doctest package for Nix?
dspyz
CC BY-SA 4.0
2022-01-17T05:30:15.140Z
2022-01-17T05:30:15.140Z
angerman
<p>I copied the plutus-starter template: <a href="https://github.com/input-output-hk/plutus-starter" rel="nofollow noreferrer">https://github.com/input-output-hk/plutus-starter</a> and created a file <code>BasicPlutusTx.hs</code> (and added it under <code>exposed-modules</code> in the <code>.cabal</code> file).</p>
<p>Then I started copying over all the code from the introductory tutorial: <a href="https://plutus.readthedocs.io/en/latest/plutus/tutorials/plutus-tx.html" rel="nofollow noreferrer">https://plutus.readthedocs.io/en/latest/plutus/tutorials/plutus-tx.html</a>
which includes doctests. What do I need to add to the <code>.cabal</code> file to run these doctests?</p>

CC BY-SA 4.0
2022-01-22T11:54:58.127Z
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
Community
<plutustx><plutus-starter>
How do I run doctests?
# How do I run doctests?

(Asked by: username_0 on 2022-01-16)

I copied the plutus-starter template: <https://github.com/input-output-hk/plutus-starter> and created a file `BasicPlutusTx.hs` (and added it under `exposed-modules` in the `.cabal` file).

Then I started copying over all the code from the introductory tutorial: <https://plutus.readthedocs.io/en/latest/plutus/tutorials/plutus-tx.html>
which includes doctests. What do I need to add to the `.cabal` file to run these doctests?

**Tags:** plutustx, plutus-starter
> **Comments:**
> **username_1**: Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.  

---

## 1 answers

### Answer by username_2 on 2022-01-17. Score: 1

To run `doctest`, you don't need to add that to your cabal file. You need to install the `doctest` executable, and then run `cabal repl --with-ghc=doctest`. See the [doctest documentation](https://github.com/sol/doctest).

> **Comments:**
> **username_0**: IIUC, I can only use things that are installed with Nix in this project. How do I find and install the doctest package for Nix?  

---

