Patchwork [STABLE] test-highlight: add normalization rule for Pygments 2.2

login
register
mail settings
Submitter Yuya Nishihara
Date Jan. 30, 2017, 2:12 p.m.
Message ID <ea5353feeec3c2eddd7e.1485785576@mimosa>
Download mbox | patch
Permalink /patch/18276/
State Accepted
Headers show

Comments

Yuya Nishihara - Jan. 30, 2017, 2:12 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1485784220 -32400
#      Mon Jan 30 22:50:20 2017 +0900
# Branch stable
# Node ID ea5353feeec3c2eddd7e4acfd398baddaf37b3e4
# Parent  f10b46a8f6a14e9fa84e8d2b1f590cf304d23224
test-highlight: add normalization rule for Pygments 2.2

The test failed on Debian sid because of new class="vm".
Anton Shestakov - Jan. 30, 2017, 2:47 p.m.
On Mon, 30 Jan 2017 23:12:56 +0900
Yuya Nishihara <yuya@tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1485784220 -32400
> #      Mon Jan 30 22:50:20 2017 +0900
> # Branch stable
> # Node ID ea5353feeec3c2eddd7e4acfd398baddaf37b3e4
> # Parent  f10b46a8f6a14e9fa84e8d2b1f590cf304d23224
> test-highlight: add normalization rule for Pygments 2.2
> 
> The test failed on Debian sid because of new class="vm".
> 
> diff --git a/tests/test-highlight.t b/tests/test-highlight.t
> --- a/tests/test-highlight.t
> +++ b/tests/test-highlight.t
> @@ -13,6 +13,7 @@
>    $ filterhtml () {
>    >   sed -e "s/class=\"k\"/class=\"kn\"/g" \
>    >       -e "s/class=\"mf\"/class=\"mi\"/g" \
> +  >       -e "s/class=\"vm\"/class=\"n\"/g" \
>    >       -e "s/class=\"\([cs]\)[h12]\"/class=\"\1\"/g"
>    > }

LGTM.

I didn't run tests or anything, but here's the commit that adds "vm"
class [1], and the class is used in python lexer for magic variables
(Name.Variable.Magic). Replacing it with "n" (Name) seems correct.

[1]:
https://bitbucket.org/birkenfeld/pygments-main/commits/a062965ef8a30068a27927f2eb73b7ad75bf8e9e
Augie Fackler - Jan. 30, 2017, 2:49 p.m.
> On Jan 30, 2017, at 09:47, Anton Shestakov <av6@dwimlabs.net> wrote:
> 
> On Mon, 30 Jan 2017 23:12:56 +0900
> Yuya Nishihara <yuya@tcha.org> wrote:
> 
>> # HG changeset patch
>> # User Yuya Nishihara <yuya@tcha.org>
>> # Date 1485784220 -32400
>> #      Mon Jan 30 22:50:20 2017 +0900
>> # Branch stable
>> # Node ID ea5353feeec3c2eddd7e4acfd398baddaf37b3e4
>> # Parent  f10b46a8f6a14e9fa84e8d2b1f590cf304d23224
>> test-highlight: add normalization rule for Pygments 2.2
>> 
>> The test failed on Debian sid because of new class="vm".
>> 
>> diff --git a/tests/test-highlight.t b/tests/test-highlight.t
>> --- a/tests/test-highlight.t
>> +++ b/tests/test-highlight.t
>> @@ -13,6 +13,7 @@
>>   $ filterhtml () {
>>>  sed -e "s/class=\"k\"/class=\"kn\"/g" \
>>>      -e "s/class=\"mf\"/class=\"mi\"/g" \
>> +  >       -e "s/class=\"vm\"/class=\"n\"/g" \
>>>      -e "s/class=\"\([cs]\)[h12]\"/class=\"\1\"/g"
>>> }
> 
> LGTM.

Queued, thanks!

> 
> I didn't run tests or anything, but here's the commit that adds "vm"
> class [1], and the class is used in python lexer for magic variables
> (Name.Variable.Magic). Replacing it with "n" (Name) seems correct.
> 
> [1]:
> https://bitbucket.org/birkenfeld/pygments-main/commits/a062965ef8a30068a27927f2eb73b7ad75bf8e9e
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/tests/test-highlight.t b/tests/test-highlight.t
--- a/tests/test-highlight.t
+++ b/tests/test-highlight.t
@@ -13,6 +13,7 @@ 
   $ filterhtml () {
   >   sed -e "s/class=\"k\"/class=\"kn\"/g" \
   >       -e "s/class=\"mf\"/class=\"mi\"/g" \
+  >       -e "s/class=\"vm\"/class=\"n\"/g" \
   >       -e "s/class=\"\([cs]\)[h12]\"/class=\"\1\"/g"
   > }