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

Re: [PATCH 1/2] t4018: add missing test cases for PHP

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 6, 2018, 21:59 UTC
Message-ID
<xmqq36wwhvpg.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180703131540.60789-2-dev@whileimautomaton.net>
Kana Natsuno <dev@whileimautomaton.net> writes:
Show 46 quoted lines
> A later patch changes the built-in PHP pattern. These test cases
> demonstrate aspects of the pattern that we do not want to change.
>
> Signed-off-by: Kana Natsuno <dev@whileimautomaton.net>
> ---
>  t/t4018/php-class    | 4 ++++
>  t/t4018/php-function | 4 ++++
>  t/t4018/php-method   | 7 +++++++
>  3 files changed, 15 insertions(+)
>  create mode 100644 t/t4018/php-class
>  create mode 100644 t/t4018/php-function
>  create mode 100644 t/t4018/php-method
>
> diff --git a/t/t4018/php-class b/t/t4018/php-class
> new file mode 100644
> index 0000000..7785b63
> --- /dev/null
> +++ b/t/t4018/php-class
> @@ -0,0 +1,4 @@
> +class RIGHT
> +{
> +    const FOO = 'ChangeMe';
> +}
> diff --git a/t/t4018/php-function b/t/t4018/php-function
> new file mode 100644
> index 0000000..35717c5
> --- /dev/null
> +++ b/t/t4018/php-function
> @@ -0,0 +1,4 @@
> +function RIGHT()
> +{
> +    return 'ChangeMe';
> +}
> diff --git a/t/t4018/php-method b/t/t4018/php-method
> new file mode 100644
> index 0000000..03af1a6
> --- /dev/null
> +++ b/t/t4018/php-method
> @@ -0,0 +1,7 @@
> +class Klass
> +{
> +    public static function RIGHT()
> +    {
> +        return 'ChangeMe';
> +    }
> +}

I no longer speak PHP, and certainly not the modern variant, but these examples all look good to me.

Whoever invented the convetion to use RIGHT/ChangeMe in t4018 should get praised---its brilliance shines in new tests like these ;-)

Previous: Kana NatsunoNext: Kana Natsuno
Message 3 of 4 in “userdiff: support new keywords in PHP hunk header”
  1. 0/2 userdiff: support new keywords in PHP hunk headerKana Natsuno, Jul 3, 2018
  2. 1/2 t4018: add missing test cases for PHPKana Natsuno, Jul 3, 2018
  3. Junio C HamanoJul 6, 2018
  4. 2/2 userdiff: support new keywords in PHP hunk headerKana Natsuno, Jul 3, 2018

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.