Commit 138f365
authored
Snapshot Testing for CGP Proc Macros (#236)
* Draft implement new assert_delegate_components macro
* Add pretty_format helper
* Use pretty_format in assert_delegate_components
* Try file-based snapshot
* Inline snapshot now works
* Put original code first before snapshot
* Migrate more tests to assert_delegate_components
* Rename to snapshot_delegate_components
* Allow arbitrary expression in body
* Add MacroSnapshot::wrap_output helper
* Add snapshot_cgp_component
* Add cgp-macro-test-util-lib crate
* Refactor snapshot_delegate_components macro
* Add back snapshot_cgp_component
* Snapshot cgp_component is now working
* Format output as string inside macro
* Implement `snapshot_cgp_impl!`
* Implement `snapshot_cgp_auto_getter!`
* Move pretty_format to test-util-lib
* AI-migrate tests
* Implement `snapshot_cgp_fn!`
* Use fully qualified `insta::assert_snapshot!`
* Add `snapshot_cgp_namespace!` macro
* Add `snapshot_cgp_type!` macro
* Add `snapshot_check_components!` and `snapshot_delegate_and_check_components!`
* Add StatementMacroSnapshot
* Add AttributeMacroSnapshot
* Remove SnapshotCgpComponent
* Migrate all other macros
* Add `snapshot_cgp_provider!` macro
* Fix formatting1 parent cd96aa9 commit 138f365
118 files changed
Lines changed: 18801 additions & 1716 deletions
File tree
- crates
- macros
- cgp-macro-core
- src/functions
- cgp-macro-lib
- cgp-macro-test-util-lib
- src
- entrypoints
- functions
- types
- cgp-macro-test-util
- src
- cgp-macro
- src
- tests/cgp-tests
- src
- namespaces
- tests
- async
- has_field
- use_delegate
- tests
- cgp_fn_tests
- component_tests
- abstract_types
- cgp_component
- cgp_impl
- implicit_args
- delegate_components
- extensible_data_tests
- records
- variants
- getter_tests
- abstract_type
- assoc_type
- handler_tests
- namespace_tests
- namespace_macro
- preset_tests
- basic
- generics_inheritance
- generics
- inheritance
- nested_inheritance
- wrapped
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
| 73 | + | |
| 74 | + | |
71 | 75 | | |
72 | 76 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | 10 | | |
17 | 11 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
Lines changed: 2 additions & 55 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
0 commit comments