You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: crates/pglt_test_macros/README.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Macros to help auto-generate tests based on files.
6
6
7
7
Pass a glob pattern that'll identify your files and a test-function that'll run for each file. The glob pattern has to start at the root of your crate.
8
8
9
-
You can add a `.expected.` file next to your test file. Its path will be passed to your test function so you can outcome-based assertions. (Alternatively, write snapshot tests.)
9
+
You can add a `.expected.` file next to your test file. Its path will be passed to your test function so you can make outcome-based assertions. (Alternatively, write snapshot tests.)
10
10
11
11
Given the following file structure:
12
12
@@ -56,6 +56,7 @@ pub fn somefilename()
56
56
57
57
- If you use a Rust-keyword as a file name, this'll result in invalid syntax for the generated tests.
58
58
- All files of the glob-pattern must (currently) be `.sql` files.
59
+
- The `.expected.sql` file-name will always be passed, even if the file doesn't exist.
59
60
- The macro will wrap your tests in a `mod tests { .. }` module. If you need multiple generations, wrap them in modules like so: ```mod some_test { tests_macros::gen_tests! { .. } }`.
0 commit comments