Commit 6a05a8d
committed
[hyperactor] assert_behaves!
Pull Request resolved: #1826
This adds a macro that asserts an actor's behavior; we use it to test the mesh behavior:
```
hyperactor::assert_behaves!(TestMeshController as Controller<TestMesh>);
```
It is implemented by statically validating that the actor type can bind to the defined behavior. This then provide a way to both document the intended behavior of an actor, and also to statically validate at the definition site that the behavior is implemented correctly.
(We already statically validate this at the *use* site, but then the errors are already "at a distance".)
ghstack-source-id: 323322439
Differential Revision: [D86786231](https://our.internmc.facebook.com/intern/diff/D86786231/)
**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D86786231/)!1 parent bf286dc commit 6a05a8d
2 files changed
+38
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
732 | 732 | | |
733 | 733 | | |
734 | 734 | | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
735 | 772 | | |
736 | 773 | | |
737 | 774 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | 67 | | |
69 | 68 | | |
70 | 69 | | |
| |||
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
| 116 | + | |
127 | 117 | | |
0 commit comments