Test that StructMeta properly processes fields.
()
| 47 | |
| 48 | |
| 49 | def test_struct_meta_field_processing(): |
| 50 | """Test that StructMeta properly processes fields.""" |
| 51 | |
| 52 | class CustomStruct(metaclass=StructMeta): |
| 53 | x: int |
| 54 | y: str = "default" |
| 55 | |
| 56 | # Verify struct functionality |
| 57 | instance = CustomStruct(x=1) |
| 58 | assert instance.x == 1 |
| 59 | assert instance.y == "default" |
| 60 | |
| 61 | # Check struct metadata |
| 62 | assert hasattr(CustomStruct, "__struct_fields__") |
| 63 | assert "x" in CustomStruct.__struct_fields__ |
| 64 | assert "y" in CustomStruct.__struct_fields__ |
| 65 | |
| 66 | |
| 67 | def test_struct_meta_with_struct_base(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…