Swift: reject uppercase acronyms in schema

This was causing hardly debuggable errors because names are transformed
to underscored lowercase names in the dbscheme and back to camelcase
for trap emission classes, which is not a noop in case uppercase
acronyms (like SIL or ABI) are in the name.

This makes the error be surfaced early with a helpful message.
This commit is contained in:
Paolo Tranquilli
2022-11-23 13:56:03 +01:00
parent 686a1cbafe
commit 876add5214
2 changed files with 18 additions and 2 deletions

View File

@@ -669,5 +669,16 @@ def test_null_class_cannot_be_defined_multiple_times():
pass
def test_uppercase_acronyms_are_rejected():
with pytest.raises(schema.Error):
@schema.load
class data:
class Root:
pass
class ROTFLNode(Root):
pass
if __name__ == '__main__':
sys.exit(pytest.main([__file__] + sys.argv[1:]))