Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed symbol test behavior breaks existing syntax tests. #6539

Closed
deathaxe opened this issue Nov 30, 2024 · 2 comments
Closed

Changed symbol test behavior breaks existing syntax tests. #6539

deathaxe opened this issue Nov 30, 2024 · 2 comments

Comments

@deathaxe
Copy link
Collaborator

Description of the bug

related with failing tests of sublimehq/Packages#4101

ST 4184 introduces changes, which cause existing symbol tests to fail, which worked before.

Such a change is not listed in changelog and any attempt to change test assertions raises other kinds of errors.

Steps to reproduce

  1. Start ST in SAFE MODE
  2. checkout ShellScript from current https://github.com/sublimehq/Packages master branch
  3. run syntax tests.

Expected behavior

Tests succeed as in ST4183.

Actual behavior

Packages/ShellScript/Zsh/tests/syntax_test_symbol.zsh:58:4
error: symbol before transformation `func3'
` (reference) does not match expected `func3` (reference)
58 |   'func3'
59 | #  @@@@@ reference

actual:
   |    @@@@@@@ reference
note: the symbol `func3'
` was transformed into `func3`.

Packages/ShellScript/Zsh/tests/syntax_test_symbol.zsh:61:4
error: symbol before transformation `func3"
` (reference) does not match expected `func3` (reference)
61 |   "func3"
62 | #  @@@@@ reference

actual:
   |    @@@@@@@ reference
note: the symbol `func3"
` was transformed into `func3`.

FAILED: 2 of 31 assertions in 1 files failed
[Finished]

However tests or implementation is modified, reference tests fail the one way or the other.

The note: part is suspicious as it says symbol being transformed from func3" to func3. It appears opening quotation mark is ignored or not treated right.

Sublime Text build number

4184

Operating system & version

All, including GH Action syntax test runner

(Linux) Desktop environment and/or window manager

No response

Additional information

No response

OpenGL context information

No response

@jrappen
Copy link
Contributor

jrappen commented Dec 5, 2024

Actually it's more odd:

1. Test:

    Actual symbol:                    'func3'
    Note says symbol is:              `func3'
    Note says transformed from:       `
    Note says transformed into:       `func3`

2. Test:

    Actual symbol:                    "func3"
    Note says symbol is:              `func3"
    Note says transformed from:       `
    Note says transformed into:       `func3`

Notice backtick vs. quotes.

So whatever the note says, the first character is wrong. Transformation seems to ignore symbols in symbols.

@BenjaminSchaaf
Copy link
Member

This is actually a more general issue. view.indexed_references() returns (Region(1331, 1338), 'func3'). 1338 includes the newline after 'func3'. We've got a fix for this in the pipeline.

@deathaxe deathaxe added this to the Build 4185 milestone Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants