Skip to content

Commit

Permalink
[layout] Update test documentation (#2026)
Browse files Browse the repository at this point in the history
gherrit-pr-id: I8aec00c4246e0e9f80c90c3295ffd79921d4d8b3
  • Loading branch information
joshlf authored Nov 5, 2024
1 parent ace5bb0 commit 13c11f8
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -797,16 +797,15 @@ mod tests {

/// This macro accepts arguments in the form of:
///
/// layout(_, _, _).validate(_, _, _), Ok(Some((_, _)))
/// | | | | | | | |
/// base_size ----+ | | | | | | |
/// align -----------+ | | | | | |
/// trailing_size ------+ | | | | |
/// addr ---------------------------+ | | | |
/// bytes_len -------------------------+ | | |
/// cast_type ----------------------------+ | |
/// elems ---------------------------------------------+ |
/// split_at ---------------------------------------------+
/// layout(_, _).validate(_, _, _), Ok(Some((_, _)))
/// | | | | | | |
/// size ---------+ | | | | | |
/// align -----------+ | | | | |
/// addr ------------------------+ | | | |
/// bytes_len ----------------------+ | | |
/// cast_type -------------------------+ | |
/// elems ------------------------------------------+ |
/// split_at ------------------------------------------+
///
/// `.validate` is shorthand for `.validate_cast_and_convert_metadata`
/// for brevity.
Expand Down Expand Up @@ -839,7 +838,7 @@ mod tests {
/// `a..b`). In this case, wrap the expression in parentheses, and it
/// will become valid `tt`.
macro_rules! test {
($(:$sizes:expr =>)?
(
layout($size:tt, $align:tt)
.validate($addr:tt, $bytes_len:tt, $cast_type:tt), $expect:pat $(,)?
) => {
Expand Down

0 comments on commit 13c11f8

Please sign in to comment.