Hi,
I'm trying my first documentation test, I can't seem to get it to run.
/// Return a Region from a string.
/// Left-most, consecutive, zeros can be omitted.
///
/// # Examples
///
/// ```
/// if let Ok(_) = SomeRegion::from_string(1, "r01x1")) {
/// } else {
/// panic!("Invalid region");
/// }
/// ```
pub fn from_string(num_ints: usize, str: &str) -> Result<SomeRegion, String> {
C:\Users\Owner\rust\ues>cargo test Doc-tests
Compiling ues v0.1.0 (C:\Users\Owner\rust\ues)
Finished test [unoptimized + debuginfo] target(s) in 0.78s
Running target\debug\deps\ues-cbf46a676678809e.exe
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 17 filtered out
Earl
bes
February 9, 2021, 7:47pm
2
The third argument you give: Doc-tests
is a filter on test function names.
If you want to run just doc tests, use cargo test --doc
Hello Erik,
I get "no library targets found in package 'ues'".
So I have to have all functions and tests in lib.rs ?
I have, maybe wrongly, partitioned my functions into different files based on each struct definition.
Earl
bes
February 9, 2021, 8:14pm
4
Is it for this code: GitHub - X01XX/Unorthodox-Expert-System: An expert of its own state. Rules can be developed, revised, and used without human intervention. ?
If it is, you have not structured your code according to the standard cargo configuration.
You should try to create a new cargo project from scratch, in another directory with cargo init .
or cargo init . --lib
(if your crate is a library) and see what the directory structure looks like.
kornel
February 10, 2021, 12:25am
6
system
Closed
May 11, 2021, 12:26am
7
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.