Hi, I'm having some weird behavior running my tests. I feel like I'm missing something obvious, but I can't find what. I have a large project, and it compiles just fine.
I have one file containing some code, and a test module for that code. Here's the subsection of the file:
#[cfg(test)]
pub mod tests {
use super::*;
#[test]
pub fn fat_ptr_large_test() {
let mut arr = [0u8; 100];
for i in 0..100 {
arr[i] = i as u8;
}
let direct: Direct<[u8; 100], [u8; 20]> = Direct::new(arr.clone());
for i in 0..100 {
assert_eq!(arr[i], direct[i]);
}
}
#[test]
pub fn fat_ptr_small_test() {
let mut arr = [0u8; 20];
for i in 0..20 {
arr[i] = i as u8;
}
let direct: Direct<[u8; 20], [u8; 100]> = Direct::new(arr.clone());
for i in 0..20 {
assert_eq!(arr[i], direct[i]);
}
}
}
Now when I try to test it with cargo test -p core -- --test-threads=1
(via IntelliJ IDEA),
- All of my other tests run and pass
- It appears to try to treat these tests a doc-tests
- They fail to compile
Take a look at the end of the output:
test threading::threadpool::tests::dim_helper ... ok
test threading::threadpool::tests::helper_channel ... ok
test result: ok. 37 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Doc-tests core
error[E0432]: unresolved import `core::array`
--> C:\Users\kahlo\Desktop\Rust\rustcraft\core\src\collections\direct.rs:2:11
|
2 | use core::array::FixedSizeArray;
| ^^^^^ Could not find `array` in `core`
error[E0432]: unresolved import `core::marker`
--> C:\Users\kahlo\Desktop\Rust\rustcraft\core\src\collections\direct.rs:3:11
|
3 | use core::marker::Unsize;
| ^^^^^^ Could not find `marker` in `core`
error[E0432]: unresolved import `core::ops`
--> C:\Users\kahlo\Desktop\Rust\rustcraft\core\src\collections\direct.rs:4:11
|
4 | use core::ops::CoerceUnsized;
| ^^^ Could not find `ops` in `core`
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Process finished with exit code 0
I am running on the nightly channel (I am using nightly-only features) and I literally just updated with rustup.
Any suggestions? Thanks.