Introduce tests/test_utils/mod.rs and use it consistently

To share helper macros between various tests/* we added a new module
(tests/macros/mod.rs). This made the prologue to be used in tests quite
long and a little weird:
```
#[macro_use]
#[path = "macros/mod.rs"]
mod macros;
use sqlparser::test_utils::*;
```

This simplifies it to:
```
#[macro_use]
mod test_utils;
use test_utils::*;
```
- and switches all existing tests to the new prologue simultaneously...

...while fixing a few other inconsistencies and adding a few comments
about the way `test_utils` work.
This commit is contained in:
Nickolay Ponomarev 2020-10-05 07:43:51 +03:00
parent 99fb633221
commit 4128dfe1db
10 changed files with 48 additions and 12 deletions

View file

@ -43,4 +43,5 @@ pub mod tokenizer;
#[doc(hidden)]
// This is required to make utilities accessible by both the crate-internal
// unit-tests and by the integration tests <https://stackoverflow.com/a/44541071/1026>
// External users are not supposed to rely on this module.
pub mod test_utils;