comline/tests/idl/simple.ids
2023-06-24 04:16:35 +01:00

32 lines
643 B
Plaintext

namespace tests.idl.simple
const POWER: u8 = 10
const DEFAULT_NAME: str = f"flower {POWER}"
settings Test {
forbid_optional_indexing=True
}
struct Message {
1# name: str = DEFAULT_NAME
@validators=[StringBounds(min_chars=3 max_chars=12)]
2# optional recipient: str = "bee"
}
error RecipientNotFoundError {
message = f"Recipient with name {self.recipient} not found"
@validators=[StringBounds(min_chars=8 max_chars=16)]
1# recipient: str
}
@provider=Any
protocol Mail {
@timeout_ms=1000
1# function send_message(message: Message) -> str
! RecipientNotFoundError(function.message.recipient)
}