# \#testing

**URL:** https://racket.discourse.group/tag/testing/56.md

[Latest](https://racket.discourse.group/latest.md) · [Categories](https://racket.discourse.group/categories.md) · [Tags](https://racket.discourse.group/tags.md)

---

## [Providing name only to sub-module?](https://racket.discourse.group/t/providing-name-only-to-sub-module/3918)

<div class="topic-metadata">

**Author:** [@pcn](https://racket.discourse.group/u/pcn)\
**Replies:** 11\
**Last updated:** [October 12, 2025, 12:06am UTC](https://racket.discourse.group/t/providing-name-only-to-sub-module/3918 "2025-10-12T00:06:45Z")

</div>

Context: Inspired by Lean's #guard commands, I'd like to implement "static unit tests" in Racket, where tests give the same interactive feedback as types. An example would look something like below: (define (factorial …

---

## [Using \`check-equal?\` with minor variations in expected data?](https://racket.discourse.group/t/using-check-equal-with-minor-variations-in-expected-data/3840)

<div class="topic-metadata">

**Author:** [@greghendershott](https://racket.discourse.group/u/greghendershott)\
**Replies:** 8\
**Last updated:** [July 9, 2025, 4:21pm UTC](https://racket.discourse.group/t/using-check-equal-with-minor-variations-in-expected-data/3840 "2025-07-09T16:21:56Z")

</div>

I have a test, where the expected results are slightly different when run under an older version of something. I needed to adapt the test to deal with both older and newer expected values. So I (not proudly) changed the…

---

## [Mocking system effectively](https://racket.discourse.group/t/mocking-system-effectively/3643)

<div class="topic-metadata">

**Author:** [@robertpostill](https://racket.discourse.group/u/robertpostill)\
**Replies:** 7\
**Last updated:** [March 26, 2025, 9:47am UTC](https://racket.discourse.group/t/mocking-system-effectively/3643 "2025-03-26T09:47:07Z")

</div>

I'm trying to mock a side-effect-riddled process. Part of this is to wrap a call to ifconfig. The code I'm wrapping looks like this: (define (get-mac-address #:ifconfig-invoker \[system system\]) (define mac-address-r…

---

## [Racket Mode emacs, test coverage not working on match?](https://racket.discourse.group/t/racket-mode-emacs-test-coverage-not-working-on-match/1898)

<div class="topic-metadata">

**Author:** [@jlucero805](https://racket.discourse.group/u/jlucero805)\
**Replies:** 4\
**Last updated:** [May 6, 2023, 2:50pm UTC](https://racket.discourse.group/t/racket-mode-emacs-test-coverage-not-working-on-match/1898 "2023-05-06T14:50:41Z")

</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). When running this, everything gets covered, besides match expressions. When using other …

---

## [TIL: Enforcing contracts with \`contract-out\` from within an embedded test module](https://racket.discourse.group/t/til-enforcing-contracts-with-contract-out-from-within-an-embedded-test-module/525)

<div class="topic-metadata">

**Author:** [@sschwarzer](https://racket.discourse.group/u/sschwarzer)\
**Replies:** 1\
**Last updated:** [January 4, 2022, 10:40pm UTC](https://racket.discourse.group/t/til-enforcing-contracts-with-contract-out-from-within-an-embedded-test-module/525 "2022-01-04T22:40:28Z")

</div>

TL;DR :wink: It's possible to enforce and test contracts defined at the module boundary within a test module in the same file. Do this by require'ing (submod "..") in the test module: (module+ test (require ... …
