Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guide new users to add use super::*; to mod test #10706

Merged
merged 5 commits into from
May 29, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/cargo/ops/cargo_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,8 @@ fn main() {
b"\
#[cfg(test)]
mod tests {
// Uncomment this to use items from the containing module.
// use super::*;
merelymyself marked this conversation as resolved.
Show resolved Hide resolved
merelymyself marked this conversation as resolved.
Show resolved Hide resolved
#[test]
fn it_works() {
let result = 2 + 2;
Expand Down
2 changes: 2 additions & 0 deletions tests/testsuite/init/auto_git/out/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[cfg(test)]
mod tests {
// Uncomment this to use items from the containing module.
// use super::*;
#[test]
fn it_works() {
let result = 2 + 2;
Expand Down
2 changes: 2 additions & 0 deletions tests/testsuite/init/formats_source/out/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[cfg(test)]
mod tests {
// Uncomment this to use items from the containing module.
// use super::*;
#[test]
fn it_works() {
let result = 2 + 2;
Expand Down
2 changes: 2 additions & 0 deletions tests/testsuite/init/fossil_autodetect/out/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[cfg(test)]
mod tests {
// Uncomment this to use items from the containing module.
// use super::*;
#[test]
fn it_works() {
let result = 2 + 2;
Expand Down
2 changes: 2 additions & 0 deletions tests/testsuite/init/git_autodetect/out/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[cfg(test)]
mod tests {
// Uncomment this to use items from the containing module.
// use super::*;
#[test]
fn it_works() {
let result = 2 + 2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[cfg(test)]
mod tests {
// Uncomment this to use items from the containing module.
// use super::*;
#[test]
fn it_works() {
let result = 2 + 2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[cfg(test)]
mod tests {
// Uncomment this to use items from the containing module.
// use super::*;
#[test]
fn it_works() {
let result = 2 + 2;
Expand Down
2 changes: 2 additions & 0 deletions tests/testsuite/init/mercurial_autodetect/out/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[cfg(test)]
mod tests {
// Uncomment this to use items from the containing module.
// use super::*;
#[test]
fn it_works() {
let result = 2 + 2;
Expand Down
2 changes: 2 additions & 0 deletions tests/testsuite/init/pijul_autodetect/out/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[cfg(test)]
mod tests {
// Uncomment this to use items from the containing module.
// use super::*;
#[test]
fn it_works() {
let result = 2 + 2;
Expand Down
2 changes: 2 additions & 0 deletions tests/testsuite/init/simple_git/out/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[cfg(test)]
mod tests {
// Uncomment this to use items from the containing module.
// use super::*;
#[test]
fn it_works() {
let result = 2 + 2;
Expand Down
2 changes: 2 additions & 0 deletions tests/testsuite/init/simple_git_ignore_exists/out/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[cfg(test)]
mod tests {
// Uncomment this to use items from the containing module.
// use super::*;
#[test]
fn it_works() {
let result = 2 + 2;
Expand Down
2 changes: 2 additions & 0 deletions tests/testsuite/init/simple_hg/out/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[cfg(test)]
mod tests {
// Uncomment this to use items from the containing module.
// use super::*;
#[test]
fn it_works() {
let result = 2 + 2;
Expand Down
2 changes: 2 additions & 0 deletions tests/testsuite/init/simple_hg_ignore_exists/out/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[cfg(test)]
mod tests {
// Uncomment this to use items from the containing module.
// use super::*;
#[test]
fn it_works() {
let result = 2 + 2;
Expand Down
2 changes: 2 additions & 0 deletions tests/testsuite/init/simple_lib/out/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[cfg(test)]
mod tests {
// Uncomment this to use items from the containing module.
// use super::*;
#[test]
fn it_works() {
let result = 2 + 2;
Expand Down
2 changes: 2 additions & 0 deletions tests/testsuite/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ fn simple_lib() {
contents,
r#"#[cfg(test)]
mod tests {
// Uncomment this to use items from the containing module.
// use super::*;
#[test]
fn it_works() {
let result = 2 + 2;
Expand Down