1# Tests 2 3Many of the tests in this repository are based on [pin-project's tests](https://github.com/taiki-e/pin-project/tree/HEAD/tests). 4 5To run all tests, run the following command: 6 7```sh 8cargo +nightly test --all 9``` 10 11## UI tests (`ui`, `compiletest.rs`) 12 13This checks errors detected by the macro or the Rust compiler in the resulting 14expanded code. 15 16To run this test, run the following command: 17 18```sh 19cargo +nightly test --test compiletest 20``` 21 22Locally, this test updates the files in the `ui` directory if there are 23changes to the generated code. If there are any changes to the files in the 24`ui` directory after running the test, please commit them. 25 26See also [`trybuild` documentation](https://docs.rs/trybuild). 27 28## Expansion tests (`expand`, `expandtest.rs`) 29 30Similar to ui tests, but instead of checking the compiler output, this checks 31the code generated by macros. 32 33See pin-project's [examples](https://github.com/taiki-e/pin-project/tree/HEAD/examples) 34for descriptions of what the generated code does, and why it needs to be generated. 35 36To run this test, run the following command: 37 38```sh 39cargo +nightly test --test expandtest 40``` 41 42Locally, this test updates the files in the `expand` directory if there are 43changes to the generated code. If there are any changes to the files in the 44`expand` directory after running the test, please commit them. 45 46See also [`macrotest` documentation](https://docs.rs/macrotest). 47