title: How to call functions that aren't inside a module from the test module?
body: <p>These are the contents of my <code>src/lib.rs</code> file:</p>
  
  <pre><code>pub fn foo() {}
  
  #[cfg(test)]
  mod tests {
      #[test]
      fn it_works() {
          foo();
      }
  }
  </code></pre>
  
  <p>When I run <code>cargo test</code>, I get the following error:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0425]: cannot find function `foo` in this scope
   --&gt; src/lib.rs:7:9
    |
  7 |         foo();
    |         ^^^ not found in this scope
  </code></pre>
  
  <p>How do I call <code>foo</code> from inside the <code>test</code> module?</p>