aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--codegen/src/ext.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/codegen/src/ext.rs b/codegen/src/ext.rs
index 94fdd51..d489bf0 100644
--- a/codegen/src/ext.rs
+++ b/codegen/src/ext.rs
@@ -396,3 +396,15 @@ fn expand_state_table<'cx>(
MacEager::expr(ast)
}
+
+#[cfg(test)]
+mod tests {
+ use definitions::{State, Action};
+ use super::Transition;
+
+ #[test]
+ fn pack_u8() {
+ let transition = Transition::StateAction(State::CsiParam, Action::Collect);
+ assert_eq!(transition.pack_u8(), 0x24);
+ }
+}