mod dialect;
mod dispatch;
mod docs;
mod enums;
mod error;
mod groups;
mod layout;
mod messages;
mod names;
mod naming;
mod views;
use refix_dictionary::{Dictionary, dictionary};
use crate::Generated;
use crate::conversion::{Conversion, unclaimed_types, uses};
use crate::envelope::Envelope;
use dialect::emit_dialect;
use dispatch::emit_dispatch;
use enums::emit_enum;
pub use error::Error;
use groups::{emit_group_module, shared_groups};
use messages::emit_message;
use names::Names;
use views::emit_view;
pub fn generate(dictionary: &Dictionary, source: &str) -> Result<Generated, Error> {
let mut warnings = Vec::new();
let names = Names::new(dictionary, &mut warnings)?;
let envelope = Envelope::of(dictionary);
let header = format!(
"// @generated by refix codegen from {source}. Do not edit.\n#![cfg_attr(rustfmt, rustfmt::skip)]\n#![allow(clippy::module_inception)]\n"
);
let enums: Vec<String> = dictionary
.fields()
.iter()
.filter(|field| Conversion::of(field).is_enum())
.map(|field| emit_enum(field, &names))
.collect();
let groups: Vec<String> = shared_groups(dictionary)
.into_iter()
.map(|group| emit_group_module(group, &names))
.collect();
let views: Vec<String> = envelope
.sections
.iter()
.map(|section| emit_view(*section, dictionary, &envelope, &names))
.collect();
let messages: Vec<String> = dictionary
.messages()
.map(|message| emit_message(message, &envelope, &names))
.collect();
let sections = std::iter::once(emit_dialect(dictionary))
.chain(enums)
.chain(groups)
.chain(views)
.chain(messages)
.chain(emit_dispatch(dictionary))
.collect::<Vec<String>>()
.join("\n");
let has_groups = !envelope.with_groups.is_empty()
|| dictionary.messages().any(|message| {
message
.members()
.any(|member| matches!(member, dictionary::Member::Group(_)))
});
let mut imports = vec!["Dialect", "InvalidValue", "KnownTags", "RawMessage", "Tag"];
if has_groups {
imports.extend(["GroupTable", "Instances"]);
}
if uses(dictionary, |conversion| {
matches!(
conversion,
Conversion::MultipleValues | Conversion::MultipleStr
)
}) {
imports.push("MultipleValues");
}
if uses(dictionary, |conversion| conversion == Conversion::Decimal) {
imports.push("Decimal");
}
if uses(dictionary, |conversion| conversion == Conversion::Date) {
imports.push("Date");
}
if uses(dictionary, |conversion| conversion == Conversion::MonthYear) {
imports.push("MonthYear");
}
if uses(dictionary, |conversion| conversion == Conversion::Time) {
imports.push("Time");
}
if uses(dictionary, |conversion| {
conversion == Conversion::UtcTimestamp
}) {
imports.push("UtcTimestamp");
}
imports.sort_unstable();
let imports = format!("use refix_message::{{{}}};", imports.join(", "));
let code = format!("{header}\n{imports}\n\n{sections}");
warnings.extend(unclaimed_types(dictionary));
Ok(Generated { code, warnings })
}
#[cfg(test)]
mod tests {
use super::*;
use crate::Warning;
use refix_dictionary::Tag;
use refix_dictionary::spec::{
Category, DataType, EnumValue, Field, FieldRef, Group, Member, Message, Protocol, Spec,
Version,
};
fn field(name: &str, tag: u32, data_type: DataType) -> Field {
Field {
name: name.to_owned(),
tag: Tag(tag),
data_type,
length_tag: None,
values: vec![],
}
}
fn spec_of(messages: Vec<Message>, fields: Vec<Field>) -> Spec {
Spec {
version: Version {
protocol: Protocol::Fix,
major: 4,
minor: 4,
service_pack: 0,
},
header: vec![],
trailer: vec![],
messages,
components: vec![],
fields,
}
}
#[test]
fn generates_a_complete_module() {
let mut ord_type = field("OrdType", 40, DataType::Char);
ord_type.values = vec![
EnumValue {
value: "1".to_owned(),
description: "MARKET".to_owned(),
},
EnumValue {
value: "2".to_owned(),
description: "LIMIT".to_owned(),
},
];
let spec = spec_of(
vec![Message {
name: "NewOrderSingle".to_owned(),
msg_type: "D".to_owned(),
members: vec![
Member::Field(FieldRef {
tag: Tag(11),
is_required: true,
}),
Member::Field(FieldRef {
tag: Tag(38),
is_required: false,
}),
Member::Field(FieldRef {
tag: Tag(44),
is_required: false,
}),
Member::Field(FieldRef {
tag: Tag(40),
is_required: false,
}),
],
category: Category::App,
}],
vec![
field("ClOrdID", 11, DataType::String),
field("OrderQty", 38, DataType::Int),
field("Price", 44, DataType::Other("PRICE".to_owned())),
ord_type,
],
);
let expected = r#"// @generated by refix codegen from toy.xml. Do not edit.
#![cfg_attr(rustfmt, rustfmt::skip)]
#![allow(clippy::module_inception)]
use refix_message::{Dialect, InvalidValue, KnownTags, RawMessage, Tag};
/// The dialect of this dictionary.
pub const DIALECT: Dialect<'static> = Dialect::new();
/// The values of the `OrdType` (40) field.
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub enum OrdType<'a> {
/// `1`
Market,
/// `2`
Limit,
/// A value the dictionary does not list.
Unrecognized(&'a str),
}
impl<'a> OrdType<'a> {
pub fn from_value(value: &'a str) -> Self {
match value {
"1" => Self::Market,
"2" => Self::Limit,
unrecognized => Self::Unrecognized(unrecognized),
}
}
pub fn value(self) -> &'a str {
match self {
Self::Market => "1",
Self::Limit => "2",
Self::Unrecognized(value) => value,
}
}
}
impl<'a> From<&'a str> for OrdType<'a> {
fn from(value: &'a str) -> Self {
Self::from_value(value)
}
}
/// The `NewOrderSingle` (35=D) message.
pub struct NewOrderSingle(RawMessage);
impl NewOrderSingle {
pub const MSG_TYPE: &[u8] = b"D";
pub const KNOWN_TAGS: KnownTags<'static> = KnownTags::new(&[
Tag(11), Tag(38), Tag(40), Tag(44),
]);
pub fn from_raw(raw: RawMessage) -> Self {
Self(raw)
}
pub fn raw(&self) -> &RawMessage {
&self.0
}
/// The `ClOrdID` (11) field.
#[doc(alias = "ClOrdID")]
pub fn cl_ord_id(&self) -> Result<Option<&str>, InvalidValue> {
self.0.get_str(Tag(11))
}
/// The `OrderQty` (38) field.
#[doc(alias = "OrderQty")]
pub fn order_qty(&self) -> Result<Option<i64>, InvalidValue> {
self.0.get_int(Tag(38))
}
/// The `Price` (44) field.
#[doc(alias = "Price")]
pub fn price_raw(&self) -> Option<&[u8]> {
self.0.get(Tag(44))
}
/// The `OrdType` (40) field.
#[doc(alias = "OrdType")]
pub fn ord_type(&self) -> Result<Option<OrdType<'_>>, InvalidValue> {
Ok(self.0.get_str(Tag(40))?.map(OrdType::from_value))
}
}
impl std::fmt::Debug for NewOrderSingle {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "NewOrderSingle({})", self.0)
}
}
impl std::fmt::Display for NewOrderSingle {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(&self.0, f)
}
}
/// A message read as the type its MsgType names.
pub enum Message {
NewOrderSingle(NewOrderSingle),
Unrecognized(RawMessage),
}
impl Message {
pub fn from_raw(raw: RawMessage) -> Self {
match raw.get(Tag(35)) {
Some(NewOrderSingle::MSG_TYPE) => Self::NewOrderSingle(NewOrderSingle::from_raw(raw)),
_ => Self::Unrecognized(raw),
}
}
}
impl std::fmt::Debug for Message {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::NewOrderSingle(message) => std::fmt::Debug::fmt(message, f),
Self::Unrecognized(raw) => write!(f, "Unrecognized({raw})"),
}
}
}
impl std::fmt::Display for Message {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::NewOrderSingle(message) => std::fmt::Display::fmt(message, f),
Self::Unrecognized(raw) => std::fmt::Display::fmt(raw, f),
}
}
}
"#;
let generated = generate(&spec.resolve().unwrap().dictionary, "toy.xml").unwrap();
assert_eq!(generated.code, expected);
assert_eq!(
generated.warnings,
[Warning::UnclaimedType {
field: "Price".to_owned(),
data_type: DataType::Other("PRICE".to_owned()),
}]
);
}
#[test]
fn a_dictionary_without_messages_has_no_message_enum() {
let spec = spec_of(vec![], vec![]);
let code = generate(&spec.resolve().unwrap().dictionary, "toy.xml")
.unwrap()
.code;
assert!(!code.contains("pub enum Message"));
}
#[test]
fn the_dialect_lists_every_linked_length_tag_in_order() {
let spec = spec_of(
vec![],
vec![
field("VenueDataLen", 5001, DataType::Length),
Field {
length_tag: Some(Tag(5001)),
..field("VenueData", 5002, DataType::Data)
},
field("RawDataLength", 95, DataType::Length),
Field {
length_tag: Some(Tag(95)),
..field("RawData", 96, DataType::Data)
},
],
);
let code = generate(&spec.resolve().unwrap().dictionary, "toy.xml")
.unwrap()
.code;
assert!(code.contains(
"pub const DIALECT: Dialect<'static> = Dialect::new().with_extra_length_tags(&[Tag(95), Tag(5001)]);\n"
));
}
#[test]
fn imports_multiple_values_only_when_read() {
let mut exec_inst = field("ExecInst", 18, DataType::MultipleStringValue);
exec_inst.values = vec![EnumValue {
value: "1".to_owned(),
description: "NOT_HELD".to_owned(),
}];
let order = |members| Message {
name: "NewOrderSingle".to_owned(),
msg_type: "D".to_owned(),
members,
category: Category::App,
};
let reads = spec_of(
vec![order(vec![Member::Field(FieldRef {
tag: Tag(18),
is_required: false,
})])],
vec![exec_inst.clone()],
);
let unused = spec_of(vec![order(vec![])], vec![exec_inst]);
let imports = |spec: Spec| {
let code = generate(&spec.resolve().unwrap().dictionary, "toy.xml")
.unwrap()
.code;
code.lines()
.find(|line| line.starts_with("use "))
.unwrap()
.to_owned()
};
assert_eq!(
imports(reads),
"use refix_message::{Dialect, InvalidValue, KnownTags, MultipleValues, RawMessage, Tag};"
);
assert_eq!(
imports(unused),
"use refix_message::{Dialect, InvalidValue, KnownTags, RawMessage, Tag};"
);
}
#[test]
fn imports_value_types_only_when_read() {
let order = |members| Message {
name: "NewOrderSingle".to_owned(),
msg_type: "D".to_owned(),
members,
category: Category::App,
};
let imports = |spec: Spec| {
let code = generate(&spec.resolve().unwrap().dictionary, "toy.xml")
.unwrap()
.code;
code.lines()
.find(|line| line.starts_with("use "))
.unwrap()
.to_owned()
};
for (value, expected) in [
(
field("Price", 44, DataType::Price),
"use refix_message::{Decimal, Dialect, InvalidValue, KnownTags, RawMessage, Tag};",
),
(
field("SettlDate", 64, DataType::LocalMktDate),
"use refix_message::{Date, Dialect, InvalidValue, KnownTags, RawMessage, Tag};",
),
(
field("MaturityMonthYear", 200, DataType::MonthYear),
"use refix_message::{Dialect, InvalidValue, KnownTags, MonthYear, RawMessage, Tag};",
),
(
field("MDEntryTime", 273, DataType::UtcTimeOnly),
"use refix_message::{Dialect, InvalidValue, KnownTags, RawMessage, Tag, Time};",
),
(
field("TransactTime", 60, DataType::UtcTimestamp),
"use refix_message::{Dialect, InvalidValue, KnownTags, RawMessage, Tag, UtcTimestamp};",
),
(
field("DeskOrderHandlingInst", 1035, DataType::MultipleStringValue),
"use refix_message::{Dialect, InvalidValue, KnownTags, MultipleValues, RawMessage, Tag};",
),
] {
let reads = spec_of(
vec![order(vec![Member::Field(FieldRef {
tag: value.tag,
is_required: false,
})])],
vec![value.clone()],
);
let unused = spec_of(vec![order(vec![])], vec![value]);
assert_eq!(imports(reads), expected);
assert_eq!(
imports(unused),
"use refix_message::{Dialect, InvalidValue, KnownTags, RawMessage, Tag};"
);
}
}
#[test]
fn a_boolean_reads_as_a_bool_without_an_enum() {
let mut locate_reqd = field("LocateReqd", 114, DataType::Boolean);
locate_reqd.values = [("Y", "YES"), ("N", "NO")]
.map(|(value, description)| EnumValue {
value: value.to_owned(),
description: description.to_owned(),
})
.to_vec();
let spec = spec_of(
vec![Message {
name: "NewOrderSingle".to_owned(),
msg_type: "D".to_owned(),
members: vec![Member::Field(FieldRef {
tag: Tag(114),
is_required: false,
})],
category: Category::App,
}],
vec![locate_reqd],
);
let code = generate(&spec.resolve().unwrap().dictionary, "toy.xml")
.unwrap()
.code;
assert!(code.contains("pub fn locate_reqd(&self) -> Result<Option<bool>, InvalidValue> {"));
assert!(!code.contains("enum LocateReqd"));
}
#[test]
fn an_enum_named_like_a_message_is_renamed_with_a_warning() {
let mut security_status = field("SecurityStatus", 965, DataType::String);
security_status.values = vec![EnumValue {
value: "1".to_owned(),
description: "ACTIVE".to_owned(),
}];
let spec = spec_of(
vec![Message {
name: "SecurityStatus".to_owned(),
msg_type: "f".to_owned(),
members: vec![Member::Field(FieldRef {
tag: Tag(965),
is_required: false,
})],
category: Category::App,
}],
vec![security_status],
);
let generated = generate(&spec.resolve().unwrap().dictionary, "toy.xml").unwrap();
assert!(generated.code.contains("pub enum SecurityStatusEnum<'a> {"));
assert!(
generated
.code
.contains("pub struct SecurityStatus(RawMessage);")
);
assert!(
generated
.code
.contains("Result<Option<SecurityStatusEnum<'_>>, InvalidValue>")
);
assert!(matches!(
generated.warnings.as_slice(),
[Warning::Renamed { .. }]
));
}
#[test]
fn emits_messages_in_spec_order() {
let spec = spec_of(
vec![
Message {
name: "Heartbeat".to_owned(),
msg_type: "0".to_owned(),
members: vec![],
category: Category::Admin,
},
Message {
name: "TestRequest".to_owned(),
msg_type: "1".to_owned(),
members: vec![],
category: Category::Admin,
},
],
vec![],
);
let generated = generate(&spec.resolve().unwrap().dictionary, "toy.xml").unwrap();
let heartbeat = generated.code.find("pub struct Heartbeat").unwrap();
let test_request = generated.code.find("pub struct TestRequest").unwrap();
assert!(heartbeat < test_request);
}
mod groups {
use super::*;
use refix_dictionary::spec::{Component, ComponentRef};
fn field_ref(tag: u32) -> Member {
Member::Field(FieldRef {
tag: Tag(tag),
is_required: false,
})
}
fn component_ref(name: &str) -> Member {
Member::Component(ComponentRef {
name: name.to_owned(),
is_required: false,
})
}
fn group(count_tag: u32, members: Vec<Member>) -> Member {
Member::Group(Group {
count_tag: Tag(count_tag),
is_required: false,
members,
})
}
fn message(name: &str, msg_type: &str, members: Vec<Member>) -> Message {
Message {
name: name.to_owned(),
msg_type: msg_type.to_owned(),
members,
category: Category::App,
}
}
fn parties_spec(messages: Vec<Message>) -> Spec {
let mut spec = spec_of(
messages,
vec![
field("NoPartyIDs", 453, DataType::NumInGroup),
field("PartyID", 448, DataType::String),
field("NoPartySubIDs", 802, DataType::NumInGroup),
field("PartySubID", 523, DataType::String),
],
);
spec.components = vec![
Component {
name: "Parties".to_owned(),
members: vec![group(
453,
vec![field_ref(448), component_ref("PtysSubGrp")],
)],
},
Component {
name: "PtysSubGrp".to_owned(),
members: vec![group(802, vec![field_ref(523)])],
},
];
spec
}
fn generated(spec: Spec) -> Generated {
generate(&spec.resolve().unwrap().dictionary, "toy.xml").unwrap()
}
#[test]
fn generates_a_module_per_group() {
let spec = parties_spec(vec![message(
"NewOrderSingle",
"D",
vec![component_ref("Parties")],
)]);
let expected = r#"// @generated by refix codegen from toy.xml. Do not edit.
#![cfg_attr(rustfmt, rustfmt::skip)]
#![allow(clippy::module_inception)]
use refix_message::{Dialect, GroupTable, Instances, InvalidValue, KnownTags, RawMessage, Tag};
/// The dialect of this dictionary.
pub const DIALECT: Dialect<'static> = Dialect::new();
pub mod parties {
use super::*;
pub const TABLE: GroupTable<'static> = GroupTable::new(
Tag(453),
Tag(448),
&[Tag(448), Tag(802)],
&[ptys_sub_grp::TABLE],
);
pub const KNOWN_TAGS: KnownTags<'static> = KnownTags::new(&[Tag(448), Tag(523), Tag(802)]);
#[derive(Clone, Copy, Debug)]
pub struct Instance<'a>(refix_message::Scope<'a>);
impl<'a> From<refix_message::Scope<'a>> for Instance<'a> {
fn from(scope: refix_message::Scope<'a>) -> Self {
Self(scope)
}
}
impl<'a> Instance<'a> {
pub fn raw(&self) -> refix_message::Scope<'a> {
self.0
}
/// The `PartyID` (448) field.
#[doc(alias = "PartyID")]
pub fn party_id(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(448))
}
/// The instances of the `NoPartySubIDs` (802) group.
#[doc(alias = "NoPartySubIDs")]
pub fn party_sub_ids(&self) -> Result<Instances<'a, ptys_sub_grp::Instance<'a>>, InvalidValue> {
self.0.get_group(&ptys_sub_grp::TABLE, &KNOWN_TAGS).map(Instances::from)
}
}
}
pub mod ptys_sub_grp {
use super::*;
pub const TABLE: GroupTable<'static> = GroupTable::new(Tag(802), Tag(523), &[Tag(523)], &[]);
pub const KNOWN_TAGS: KnownTags<'static> = KnownTags::new(&[Tag(523)]);
#[derive(Clone, Copy, Debug)]
pub struct Instance<'a>(refix_message::Scope<'a>);
impl<'a> From<refix_message::Scope<'a>> for Instance<'a> {
fn from(scope: refix_message::Scope<'a>) -> Self {
Self(scope)
}
}
impl<'a> Instance<'a> {
pub fn raw(&self) -> refix_message::Scope<'a> {
self.0
}
/// The `PartySubID` (523) field.
#[doc(alias = "PartySubID")]
pub fn party_sub_id(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(523))
}
}
}
/// The `NewOrderSingle` (35=D) message.
pub struct NewOrderSingle(RawMessage);
impl NewOrderSingle {
pub const MSG_TYPE: &[u8] = b"D";
pub const KNOWN_TAGS: KnownTags<'static> = KnownTags::new(&[
Tag(448), Tag(453), Tag(523), Tag(802),
]);
pub fn from_raw(raw: RawMessage) -> Self {
Self(raw)
}
pub fn raw(&self) -> &RawMessage {
&self.0
}
/// The instances of the `NoPartyIDs` (453) group.
#[doc(alias = "NoPartyIDs")]
pub fn party_ids(&self) -> Result<Instances<'_, parties::Instance<'_>>, InvalidValue> {
self.0.get_group(&parties::TABLE, &Self::KNOWN_TAGS).map(Instances::from)
}
}
impl std::fmt::Debug for NewOrderSingle {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "NewOrderSingle({})", self.0)
}
}
impl std::fmt::Display for NewOrderSingle {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(&self.0, f)
}
}
/// A message read as the type its MsgType names.
pub enum Message {
NewOrderSingle(NewOrderSingle),
Unrecognized(RawMessage),
}
impl Message {
pub fn from_raw(raw: RawMessage) -> Self {
match raw.get(Tag(35)) {
Some(NewOrderSingle::MSG_TYPE) => Self::NewOrderSingle(NewOrderSingle::from_raw(raw)),
_ => Self::Unrecognized(raw),
}
}
}
impl std::fmt::Debug for Message {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::NewOrderSingle(message) => std::fmt::Debug::fmt(message, f),
Self::Unrecognized(raw) => write!(f, "Unrecognized({raw})"),
}
}
}
impl std::fmt::Display for Message {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::NewOrderSingle(message) => std::fmt::Display::fmt(message, f),
Self::Unrecognized(raw) => std::fmt::Display::fmt(raw, f),
}
}
}
"#;
let generated = generated(spec);
assert_eq!(generated.code, expected);
assert!(generated.warnings.is_empty());
}
#[test]
fn a_shared_group_is_emitted_once() {
let spec = parties_spec(vec![
message("NewOrderSingle", "D", vec![component_ref("Parties")]),
message("ExecutionReport", "8", vec![component_ref("Parties")]),
]);
let code = generated(spec).code;
assert_eq!(code.matches("pub mod parties {").count(), 1);
assert_eq!(code.matches("pub fn party_ids(&self)").count(), 2);
}
#[test]
fn group_modules_come_in_order_of_first_appearance() {
let spec = parties_spec(vec![
message("PartyDetails", "CG", vec![component_ref("PtysSubGrp")]),
message("NewOrderSingle", "D", vec![component_ref("Parties")]),
]);
let code = generated(spec).code;
let ptys_sub_grp = code.find("pub mod ptys_sub_grp {").unwrap();
let parties = code.find("pub mod parties {").unwrap();
assert!(ptys_sub_grp < parties);
}
#[test]
fn a_message_group_nests_under_the_message_module() {
let spec = spec_of(
vec![message(
"Logon",
"A",
vec![group(384, vec![field_ref(372)])],
)],
vec![
field("NoMsgTypes", 384, DataType::NumInGroup),
field("RefMsgType", 372, DataType::String),
],
);
let code = generated(spec).code;
assert!(code.contains(
"pub mod logon {\n pub mod msg_types {\n use super::super::*;\n"
));
assert!(code.contains("self.0.get_group(&logon::msg_types::TABLE, &Self::KNOWN_TAGS)"));
}
#[test]
fn a_group_in_a_group_instance_gets_a_module_in_its_parents() {
let mut spec = parties_spec(vec![message(
"NewOrderSingle",
"D",
vec![component_ref("Parties")],
)]);
spec.components = vec![Component {
name: "Parties".to_owned(),
members: vec![group(
453,
vec![field_ref(448), group(802, vec![field_ref(523)])],
)],
}];
let generated = generated(spec);
assert!(generated.code.contains(
" &[Tag(448), Tag(802)],\n &[parties::party_sub_ids::TABLE],\n );\n"
));
assert!(generated.code.contains(
" pub fn party_sub_ids(&self) -> Result<Instances<'a, parties::party_sub_ids::Instance<'a>>, InvalidValue> {\n self.0.get_group(&parties::party_sub_ids::TABLE, &KNOWN_TAGS).map(Instances::from)\n }\n"
));
assert!(generated.code.contains(
" }\n\n pub mod party_sub_ids {\n use super::super::*;\n\n pub const TABLE: GroupTable<'static> = GroupTable::new(\n Tag(802),\n"
));
assert!(generated.code.contains(
" impl<'a> Instance<'a> {\n pub fn raw(&self) -> refix_message::Scope<'a> {\n"
));
assert_eq!(generated.warnings, vec![]);
}
}
}