zsh-syntax-highlighting icon indicating copy to clipboard operation
zsh-syntax-highlighting copied to clipboard

tests: parameter-to-global-alias: Use alias name less likely to clash

Open m0vie opened this issue 4 years ago • 8 comments

m0vie avatar Aug 11 '20 20:08 m0vie

Milestoned.

Would you link to the man page of the x command (lowercase)?

danielshahaf avatar Aug 13 '20 21:08 danielshahaf

There is no man-page. It's just some script that comes with the cygwin-port of xorg-server.

$ man x
No manual entry for x

$ cygcheck -f =x
xorg-server-1.20.5-3

m0vie avatar Aug 13 '20 22:08 m0vie

Oh, actually this is upper-case X - so the same thing that exists also on Linux:

It's just that Cygwin is case-insensitive which causes this :)

m0vie avatar Aug 13 '20 22:08 m0vie

What's the output of tests/generate.zsh x main x?

Same question, when the zsh/parameter codepaths are disabled?

danielshahaf avatar Aug 14 '20 04:08 danielshahaf

What's the output of tests/generate.zsh x main x?

$ ./tests/generate.zsh x main x
Set copyright year to 2020?

BUFFER=$'x'

expected_region_highlight=(
  '1 1 command' # x
)

Same question, when the zsh/parameter codepaths are disabled?

Same. (I added zmodload -u zsh/parameter at the top of tests/generate.zsh).

m0vie avatar Aug 14 '20 20:08 m0vie

Same. (I added zmodload -u zsh/parameter at the top of tests/generate.zsh).

This is not an effective method of disabling those codepaths.

You should have figured that out by yourself, without me needing to point it out for you; for example, by running:

% git grep -n zsh/parameter
⋮
zsh-syntax-highlighting.zsh:581:zmodload zsh/parameter 2>/dev/null || true

danielshahaf avatar Aug 14 '20 22:08 danielshahaf

Oh, of course, sorry.

I removed that line and explicitly replaced it with zmodload -u zsh/parameter to be sure.

The output of tests/generate.zsh x main x remains the same, nonetheless.

Anything left to do here in this PR?

Using something more expressive (global_alias) instead of a x can't hurt either way.

m0vie avatar Aug 14 '20 23:08 m0vie

Nothing left to do; I just wanted to double-check that case insensitivity was handled correctly while we were at it. Thanks for verifying that. Milestone is already set. Cheers.

danielshahaf avatar Aug 14 '20 23:08 danielshahaf