| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -76,7 +76,7 @@ def _get_class(self, name: str) -> cpp.Class: | |||
| 76 | 76 | bases=[self._get_class(b) for b in cls.bases], | |
| 77 | 77 | fields=[ | |
| 78 | 78 | _get_field(cls, p, self._add_or_none_except) | |
| 79 | - for p in cls.properties if "cpp_skip" not in p.pragmas | ||
| 79 | + for p in cls.properties if "cpp_skip" not in p.pragmas and not p.synth | ||
| 80 | 80 | ], | |
| 81 | 81 | final=not cls.derived, | |
| 82 | 82 | trap_name=trap_name, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -203,5 +203,27 @@ def test_ipa_classes_ignored(generate): | |||
| 203 | 203 | ] | |
| 204 | 204 | ||
| 205 | 205 | ||
| 206 | + def test_synth_properties_ignored(generate): | ||
| 207 | + assert generate([ | ||
| 208 | + schema.Class( | ||
| 209 | + name="X", | ||
| 210 | + properties=[ | ||
| 211 | + schema.SingleProperty("x", "a"), | ||
| 212 | + schema.SingleProperty("y", "b", synth=True), | ||
| 213 | + schema.SingleProperty("z", "c"), | ||
| 214 | + schema.OptionalProperty("foo", "bar", synth=True), | ||
| 215 | + schema.RepeatedProperty("baz", "bazz", synth=True), | ||
| 216 | + schema.RepeatedOptionalProperty("bazzz", "bazzzz", synth=True), | ||
| 217 | + schema.RepeatedUnorderedProperty("bazzzzz", "bazzzzzz", synth=True), | ||
| 218 | + ], | ||
| 219 | + ), | ||
| 220 | + ]) == [ | ||
| 221 | + cpp.Class(name="X", final=True, trap_name="Xes", fields=[ | ||
| 222 | + cpp.Field("x", "a"), | ||
| 223 | + cpp.Field("z", "c"), | ||
| 224 | + ]), | ||
| 225 | + ] | ||
| 226 | + | ||
| 227 | + | ||
| 206 | 228 | if __name__ == '__main__': | |
| 207 | 229 | sys.exit(pytest.main([__file__] + sys.argv[1:])) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments