From: "Ghanshyam Thakkar" <shyamthakkar001@gmail.com>
To: "Karthik Nayak" <karthik.188@gmail.com>, <git@vger.kernel.org>
Cc: "Christian Couder" <christian.couder@gmail.com>,
"Phillip Wood" <phillip.wood123@gmail.com>,
"Christian Couder" <chriscool@tuxfamily.org>,
"Kaartic Sivaraam" <kaartic.sivaraam@gmail.com>
Subject: Re: [GSoC][PATCH] t: migrate helper/test-urlmatch-normalization to unit tests
Date: Mon, 22 Jul 2024 18:24:41 +0530 [thread overview]
Message-ID: <D2W30F19QN7J.146CV16OMTO6M@gmail.com> (raw)
In-Reply-To: <CAOLa=ZQ8fuCksk+CGP2thMqKnT_KME4goLwEt6hKYvt+Gbn5tw@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> wrote:
> Ghanshyam Thakkar <shyamthakkar001@gmail.com> writes:
>
> [snip]
>
> > +static void compare_normalized_urls(const char *url1, const char *url2,
> > + size_t equal)
> [ 5 more citation lines. Click/Enter to show. ]
> > +{
> > + char *url1_norm = url_normalize(url1, NULL);
> > + char *url2_norm = url_normalize(url2, NULL);
> > +
> > + if (equal) {
> > + if (!check_str(url1_norm, url2_norm))
> > + test_msg("input url1: %s\n input url2: %s", url1,
> > + url2);
>
> check_str() checks and prints the values if they don't match, so here
> since the normalized urls will be printed by check_str(), we print the
> input urls. Makes sense.
>
> > + } else if (!check_int(strcmp(url1_norm, url2_norm), !=, 0))
> > + test_msg(" url1_norm: %s\n url2_norm: %s\n"
> > + " input url1: %s\n input url2: %s",
> > + url1_norm, url2_norm, url1, url2);
>
> Here we use strcmp and hence, it won't print the normalized urls, so we
> also print them. This is because we want to make sure they are not
> equal.
>
> I don't understand why there is inconsistent spacing in this message
> though.
That is for alignment purposes, so the ':' matches vertically between
them. I.e.
# url1_norm: https://@x.y/%5E
url2_norm: https://x.y/%5E
input url1: https://@x.y/^
input url2: httpS://x.y:443/^
Thanks.
> Apart from this small question, the patch looks great!
>
> Thanks
next prev parent reply other threads:[~2024-07-22 12:54 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-28 12:56 [GSoC][PATCH] t: migrate helper/test-urlmatch-normalization to unit tests Ghanshyam Thakkar
2024-07-09 0:42 ` Ghanshyam Thakkar
2024-07-22 12:53 ` Karthik Nayak
2024-07-22 12:54 ` Ghanshyam Thakkar [this message]
2024-07-23 8:26 ` Karthik Nayak
2024-07-23 14:00 ` Patrick Steinhardt
2024-07-24 0:24 ` Ghanshyam Thakkar
2024-07-24 5:19 ` Patrick Steinhardt
2024-07-24 7:06 ` Ghanshyam Thakkar
2024-07-24 7:45 ` Patrick Steinhardt
2024-08-13 17:24 ` [GSoC][PATCH v2] t: migrate t0110-urlmatch-normalization to the new framework Ghanshyam Thakkar
2024-08-13 19:22 ` Junio C Hamano
2024-08-14 1:35 ` Kaartic Sivaraam
2024-08-14 4:58 ` Junio C Hamano
2024-08-14 14:24 ` Ghanshyam Thakkar
2024-08-14 5:17 ` Kaartic Sivaraam
2024-08-14 14:20 ` [GSoC][PATCH v3] " Ghanshyam Thakkar
2024-08-14 16:52 ` Junio C Hamano
2024-08-19 12:46 ` Christian Couder
2024-08-20 15:19 ` [GSoC][PATCH v4] " Ghanshyam Thakkar
2024-08-20 15:24 ` Ghanshyam Thakkar
2024-08-21 10:06 ` Christian Couder
2024-08-21 16:08 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D2W30F19QN7J.146CV16OMTO6M@gmail.com \
--to=shyamthakkar001@gmail.com \
--cc=chriscool@tuxfamily.org \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=kaartic.sivaraam@gmail.com \
--cc=karthik.188@gmail.com \
--cc=phillip.wood123@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).