Move unit tests inside conditionally compiled mod tests { } blocks

Idiomatic rust organizes unit tests into `mod tests { }` blocks
using conditional compilation `[cfg(test)]` to decide whether to
compile the code in that block.

This commit moves "bare" test functions into such blocks, and puts
the block at the bottom of respective file.
This commit is contained in:
Martin Algesten
2021-03-14 11:44:01 +01:00
parent 239ba342a2
commit 91cb0ce5fc
7 changed files with 295 additions and 271 deletions

View File

@@ -171,8 +171,7 @@ Proxy-Connection: Keep-Alive\r\n\
#[cfg(test)]
mod tests {
use super::Proto;
use super::Proxy;
use super::*;
#[test]
fn parse_proxy_fakeproto() {