intellij-rust icon indicating copy to clipboard operation
intellij-rust copied to clipboard

Suggestion: doctest should have the test gutter icons

Open jendrikw opened this issue 3 years ago • 4 comments

Environment

  • IntelliJ Rust plugin version: 0.4.174.4743-221
  • Rust toolchain version: 1.62.0 (a8314ef7d 2022-06-27)
  • IDE name and version: Clion 2022.1.3
  • Operating system: Arch Linux 5.17.8

Problem description

I would be nice to have the test gutter icons on doctest, to get an overview of what tests failed and to quickly rerun a single test.

Steps to reproduce

/// Example module
/// ```
/// assert_eq!(1, 2);
/// ```
mod example {}

jendrikw avatar Jul 21 '22 15:07 jendrikw

I tried to look into this, but so far I haven't found a way to execute a specific doctest. I asked about this on the forum, if there will be a way to do this, I'll try to implement it.

Kobzol avatar Jul 22 '22 09:07 Kobzol

It'd be ok for me if it run all test on a method. That is doable with cargo test --docs module::Type::method.

jendrikw avatar Jul 22 '22 11:07 jendrikw

This is not enough, because if there was a method called module::Type::method2, the mentioned command would also execute it (since module::Type::method is part of the second method's name). However, I found a way to execute a specific doctest, so this problem has been hopefully resolved. I'll try to send a PR soon if I can get it to work :)

Kobzol avatar Jul 22 '22 11:07 Kobzol

Great, thanks for looking into this!

jendrikw avatar Jul 22 '22 12:07 jendrikw