# Racket Mode emacs, test coverage not working on match?

**URL:** <https://racket.discourse.group/t/racket-mode-emacs-test-coverage-not-working-on-match/1898>\
**Category:** Questions & Answers\
**Tags:** emacs, racket-mode, testing\
**Created:** [April 28, 2023, 9:33pm UTC](https://racket.discourse.group/t/racket-mode-emacs-test-coverage-not-working-on-match/1898 "2023-04-28T21:33:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlucero805](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/jlucero805/32/1137_2.png) [@jlucero805](https://racket.discourse.group/u/jlucero805)\
**Post date:** [April 28, 2023, 9:33pm UTC](https://racket.discourse.group/t/racket-mode-emacs-test-coverage-not-working-on-match/1898/1 "2023-04-28T21:33:58Z")

</div>

In racket-mode for emacs, there is a command racket-test, that can be run with test coverage using C-u C-u C-c C-t ([Racket Mode](https://racket-mode.com/#racket_002dtest)).

When running this, everything gets covered, besides match expressions.

When using other tools such as DrRacket, or raco cover, they are getting the correct test coverage.

Has any one else ever run into this?

---

<div class="post-metadata">

**Author:** ![xgqt](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/xgqt/32/592_2.png) [@xgqt](https://racket.discourse.group/u/xgqt)\
**Post date:** [April 29, 2023, 7:10pm UTC](https://racket.discourse.group/t/racket-mode-emacs-test-coverage-not-working-on-match/1898/2 "2023-04-29T19:10:26Z")

</div>

Can you link a code example of such match-tests?

---

<div class="post-metadata">

**Author:** ![greghendershott](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/greghendershott/32/98_2.png) [@greghendershott](https://racket.discourse.group/u/greghendershott)\
**Post date:** [May 5, 2023, 9:41pm UTC](https://racket.discourse.group/t/racket-mode-emacs-test-coverage-not-working-on-match/1898/3 "2023-05-05T21:41:38Z")

</div>

It looks like an example would be:

```scheme
#lang racket/base
(require racket/match)
(define (f v)
  (match v
    [v v]))
(define (g v)
  v)
(module+ test
  (f 42)
  (g 12))

```

After `C-u C-u C-c C-t` the entire `(match __)` form is highlighted in red as "uncovered".

I opened [issue 660](https://github.com/greghendershott/racket-mode/issues/660).

---

<div class="post-metadata">

**Author:** ![jbclements](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/jbclements/32/11_2.png) [@jbclements](https://racket.discourse.group/u/jbclements)\
**Post date:** [May 5, 2023, 10:20pm UTC](https://racket.discourse.group/t/racket-mode-emacs-test-coverage-not-working-on-match/1898/4 "2023-05-05T22:20:33Z")

</div>

@greghendershott , many thanks for taking the time to build an example yourself, that's kind of above and beyond!

---

<div class="post-metadata">

**Author:** ![greghendershott](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/greghendershott/32/98_2.png) [@greghendershott](https://racket.discourse.group/u/greghendershott)\
**Post date:** [May 6, 2023, 2:50pm UTC](https://racket.discourse.group/t/racket-mode-emacs-test-coverage-not-working-on-match/1898/5 "2023-05-06T14:50:41Z")

</div>

@jlucero805 I pushed a commit to fix this, which should flow through to MELPA within a couple hours. If you want to try it, please see [updating Racket Mode](https://www.racket-mode.com/#Update).
