Re: [PATCH v2 2/8] trailer: add unit tests for trailer iterator
- From
- Linus Arver <linusa@google.com>
- Date
- Apr 19, 2024, 05:33 UTC
- Message-ID
- <owly8r19or1v.fsf@fine.c.googlers.com>
- In-Reply-To
- <e1fa05143ac63e8fe8dbc8ccb76a89b7a008c412.1713504153.git.gitgitgadget@gmail.com>
"Linus Arver via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 11 quoted lines
> From: Linus Arver <linusa@google.com>
> [...]
> + {
> + "with non-trailer lines in trailer block",
> + "subject: foo bar\n"
> + "\n"
> + /*
> + * Even though this trailer block has a non-trailer line
> + * in it, it's still a valid trailer block because it's
> + * at least 25% trailers and is Git-generated.
> + */In the next reroll (sometime next week?), I should put the
... (see git_generated_prefixes[] in trailer.c).
comment up here (where we first mention "Git-generated" trailers) instead of down in the last test case below.
Show 45 quoted lines
> + "not a trailer line\n"
> + "not a trailer line\n"
> + "not a trailer line\n"
> + "Signed-off-by: x\n",
> + 1
> + },
> + {
> + "with non-trailer lines (one too many) in trailer block",
> + "subject: foo bar\n"
> + "\n"
> + /*
> + * This block has only 20% trailers, so it's below the
> + * 25% threshold.
> + */
> + "not a trailer line\n"
> + "not a trailer line\n"
> + "not a trailer line\n"
> + "not a trailer line\n"
> + "Signed-off-by: x\n",
> + 0
> + },
> + {
> + "with non-trailer lines (only 1) in trailer block, but no Git-generated trailers",
> + "subject: foo bar\n"
> + "\n"
> + /*
> + * This block has only 1 non-trailer out of 10 (IOW, 90%
> + * trailers) but is not considered a trailer because the
> + * 25% threshold only applies to cases where there was a
> + * Git-generated trailer (see git_generated_prefixes[]
> + * in trailer.c).
> + */
> + "Reviewed-by: x\n"
> + "Reviewed-by: x\n"
> + "Reviewed-by: x\n"
> + "Helped-by: x\n"
> + "Helped-by: x\n"
> + "Helped-by: x\n"
> + "Acked-by: x\n"
> + "Acked-by: x\n"
> + "Acked-by: x\n"
> + "not a trailer line\n",
> + 0
> + },
> + };