# rust: Improve runnable detection for test modules \(\#28024\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/e5e3e9ac8c0c823f214e6905da29da511b8be89e)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: e5e3e9ac8c0c823f214e6905da29da511b8be89e

Requested commit: e5e3e9ac8c0c823f214e6905da29da511b8be89e

Commit: e5e3e9ac8c0c823f214e6905da29da511b8be89e

Tree: d30c77bcdfc1ef52d4ee8e0e75e19a99de181e80

Author: Finn Evers

Committer: GitHub

## Message

```
rust: Improve runnable detection for test modules (#28024)

Closes #28002

This PR updates the `runnabless.scm` for Rust to improve detection of
test modules with non-standard names. Instead of matching on the module
name, we now check for the `#[cfg(test)]`-attribute above test modules.
This allows for generic matching whilst not regressing the previous
behaviour.

| `main` | <img width="922" alt="main"
src="https://github.com/user-attachments/assets/34fc4443-13a2-4e18-b806-7e14771c3df4"
/> |
| --- | --- |
| This PR | <img width="922" alt="PR"
src="https://github.com/user-attachments/assets/13e6a6d8-e177-4a83-89ab-24c0a69ade27"
/> |

Release Notes:

- Improved runnable detection for test modules in Rust.
```

## Parents

- [399d19231b0aaa3abf4670c7a6ba4014a04645c1](https://git.cafe/gitcafe/zed/commit/399d19231b0aaa3abf4670c7a6ba4014a04645c1?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/e5e3e9ac8c0c823f214e6905da29da511b8be89e?format=markdown)
