git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [GSoC][PATCH v2] t: migrate t0110-urlmatch-normalization to the new framework

From
Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Date
Aug 14, 2024, 05:17 UTC
Message-ID
<4c14e3bf-0f0d-4600-8e17-5b5d15ad7447@gmail.com>
In-Reply-To
<20240813172432.55487-1-shyamthakkar001@gmail.com>
Hi Ghansyam,

I just wanted to share two comments based on what I observed from the recent changes.

On 13/08/24 22:54, Ghanshyam Thakkar wrote:
 >
Show 15 quoted lines
> index 0000000000..e0dd50dc11
> --- /dev/null
> +++ b/t/unit-tests/t-urlmatch-normalization.c
> @@ -0,0 +1,294 @@
> +
> +static void check_normalized_url_from_file(const char *file, const char *expect)
> +{
> +	struct strbuf content = STRBUF_INIT, path = STRBUF_INIT;
> +	char *cwd_basename;
> +
> +	if (!check_int(strbuf_getcwd(&path), ==, 0))
> +		return;
> +
> +	cwd_basename = basename(path.buf);
> +	if (!check(!strcmp(cwd_basename, "t") || !strcmp(cwd_basename, "bin"))) {

I think comparing blindly for "bin" would not be an ideal thing to do as this would let other locations which have the "bin" basename to be slip through. For instance, running the test from "perl/blib/bin" would result in this check letting it through. I suppose we could need a bit more specific check that ensures that the test is indeed running from "t/unit-tests/bin".

> ... snip ...
 >
Show 6 quoted lines
> +static void t_url_high_bit(void)
> +{
> +	check_normalized_url_from_file("url-1",
> +			    "x://q/%01%02%03%04%05%06%07%08%0E%0F%10%11%12");
> +	check_normalized_url_from_file("url-2",
> +			    "x://q/%13%14%15%16%17%18%19%1B%1C%1D%1E%1F%7F");

When we run the unit-test binary from other directories, the error message is thrown appropriately. But it seems to be printed for every test case which seems a bit spammy. I suppose it might be helpful to do it once before actually running the test cases and skip the cases when we realize the binary is being run from a different directory.

-- Sivaraam

Previous: Ghanshyam ThakkarNext: Ghanshyam Thakkar
Message 16 of 23 in “t: migrate helper/test-urlmatch-normalization to unit tests”
  1. Ghanshyam ThakkarJun 28, 2024
  2. Ghanshyam ThakkarJul 9, 2024
  3. Karthik NayakJul 22, 2024
  4. Ghanshyam ThakkarJul 22, 2024
  5. Karthik NayakJul 23, 2024
  6. Patrick SteinhardtJul 23, 2024
  7. Ghanshyam ThakkarJul 24, 2024
  8. Patrick SteinhardtJul 24, 2024
  9. Ghanshyam ThakkarJul 24, 2024
  10. Patrick SteinhardtJul 24, 2024
  11. [GSoC][PATCH v2] t: migrate t0110-urlmatch-normalization to the new frameworkGhanshyam Thakkar, Aug 13, 2024
  12. Junio C HamanoAug 13, 2024
  13. Kaartic SivaraamAug 14, 2024
  14. Junio C HamanoAug 14, 2024
  15. Ghanshyam ThakkarAug 14, 2024
  16. Kaartic SivaraamAug 14, 2024
  17. [GSoC][PATCH v3] t: migrate t0110-urlmatch-normalization to the new frameworkGhanshyam Thakkar, Aug 14, 2024
  18. Junio C HamanoAug 14, 2024
  19. Christian CouderAug 19, 2024
  20. [GSoC][PATCH v4] t: migrate t0110-urlmatch-normalization to the new frameworkGhanshyam Thakkar, Aug 20, 2024
  21. Ghanshyam ThakkarAug 20, 2024
  22. Christian CouderAug 21, 2024
  23. Junio C HamanoAug 21, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.