diff --git a/compiler/__tests__/parser.test.ts b/compiler/__tests__/parser.test.ts index 02a7862..4678ab3 100644 --- a/compiler/__tests__/parser.test.ts +++ b/compiler/__tests__/parser.test.ts @@ -742,4 +742,28 @@ speck Second { } }); }); + + // Cycle 60: enum interfaces (e.g. CustodyTier) parse as `kind: 'enum'` + // and the .proto generator emits a real `enum X { ... }` block. + describe('enum interfaces (cycle 60)', () => { + it('should classify bare-identifier interfaces as enums', () => { + const content = `speck FederatedMeetup { + interface CustodyTier { + ColdHardware + HotSigning + ThresholdSplit + BackupOnly + Compromised + } +}`; + const ast = parseSpeckContent(content); + const tier = ast.specks[0].members.find(m => m.name === 'CustodyTier'); + if (tier?.type === 'interface') { + expect(tier.kind).toBe('enum'); + expect(tier.methods.map(m => m.name)).toEqual([ + 'ColdHardware', 'HotSigning', 'ThresholdSplit', 'BackupOnly', 'Compromised' + ]); + } + }); + }); });