title: How to make a test dir?
body: <p>I'd like to set up a basic hello world project. The unit tests should be in the <code>test/</code> directory as described in <a href="https://doc.rust-lang.org/stable/book/testing.html" rel="noreferrer">the book</a>. My code so far is as follows.</p>
  
  <p><strong>src/main.rs</strong></p>
  
  <pre><code>pub mod player;
  
  fn main() {
      println!("Hello, world!");
  }
  </code></pre>
  
  <p><strong>src/player.rs</strong></p>
  
  <pre><code>pub fn rep(arg: i32) -&gt; i32 {
      arg
  }
  </code></pre>
  
  <p><strong>tests/player.rs</strong></p>
  
  <pre><code>extern crate player;
  
  #[test]
  fn it_works() {
      assert_eq!(4, player::rep(2+2));
  }
  </code></pre>
  
  <p><strong>Cargo.toml</strong></p>
  
  <pre><code>[package]
  name = "myapp"
  version = "0.1.0"
  authors = ["My Name &lt;spam@example.com&gt;"]
  </code></pre>
  
  <p>I believe the code is very similar to the book. However, <code>cargo test</code> fails:</p>
  
  <pre><code>tests/player.rs:1:1: 1:21 error: can't find crate for `player`
  tests/player.rs:1 extern crate player;
                ^~~~~~~~~~~~~~~~~~~~
  error: aborting due to previous error
  </code></pre>
  
  <p>What is the problem? I'm completely lost.</p>