sublime_text icon indicating copy to clipboard operation
sublime_text copied to clipboard

negative symbol tests always fail

Open jrappen opened this issue 3 years ago • 1 comments
trafficstars

Description of the bug

#3154 lists "none" as a valid category for negative testing, i.e. no symbol.

Using the test binary with a Github action workflow results in failing tests.

Steps to reproduce

As an example, use the code for the default packages re-write for JSON at:

https://github.com/jrappen/sublime-json


Here only top level keys in a top-level JSON object should be added to the symbols list:

// SYNTAX TEST "Packages/JSON/JSON.sublime-syntax"

// <- source.json - source.json.jsonc

{
    "key": "value",
//  @@@@@ definition
//  ^^^^^ meta.mapping.key - meta.mapping.value meta.mapping.key

    "key-two": { "key-two-one": "value", "key-two-two": "value" }
//  @@@@@@@@@ definition
//  ^^^^^^^^^ meta.mapping.key - meta.mapping.value meta.mapping.key
//               @@@@@@@@@@@@@ none
//               ^^^^^^^^^^^^^ meta.mapping.value meta.mapping.key
//                                       @@@@@@@@@@@@@ none
//                                       ^^^^^^^^^^^^^ meta.mapping.value meta.mapping.key
}

and:

// SYNTAX TEST "Packages/JSON/JSON.sublime-syntax"

// <- source.json - source.json.jsonc

[
    {
        "key-one": "value",
//      @@@@@@@@@ none
//      ^^^^^^^^^ meta.sequence.list meta.mapping.key
        "key-two": "value"
//      @@@@@@@@@ none
//      ^^^^^^^^^ meta.sequence.list meta.mapping.key
    }
]

Expected behavior

Passing tests.

Actual behavior

Failing tests.

/path/to/syntax_test_whatever.txt:column:line: Symbol ['xxxxxxxxxxxxxx' none] does not exist

Sublime Text build number

4131

Operating system & version

Ubuntu

Additional information

I am using the syntax test binary via Github's CI (i.e. workflow actions).

https://download.sublimetext.com/st_syntax_tests_build_***_x64.tar.xz

jrappen avatar May 16 '22 11:05 jrappen

Symbols test

Copy of docs from: https://github.com/sublimehq/sublime_text/issues/3154

Marker is @.

Supported by ST4087+.

  • none: No symbol, for negative testing.
  • local-definition: An unindexed definition, ie. it only shows in goto definition.
  • global-definition: An indexed-only definition, ie. it only shows in goto symbol in project.
  • definition: A definition that is both unindexed and indexed.
  • reference: A reference.

When a symbol test is present every symbol must be tested for exhaustively. This can be turned off using partial-symbols after SYNTAX TEST.

void foo() {
//   @@@ definition
    foo();
//  @@@ reference
}
  this() {
//@@@@ local-definition
  }

jrappen avatar May 17 '22 08:05 jrappen

Fixed in build 4147.

BenjaminSchaaf avatar Dec 22 '22 01:12 BenjaminSchaaf

@BenjaminSchaaf Please re-open as this has only been partially fixed. Documentation is still missing. Please add above info to https://www.sublimetext.com/docs/syntax.html#testing.

jrappen avatar Dec 23 '22 21:12 jrappen

@jrappen I've made a new issue for the documentation here: https://github.com/sublimehq/sublime_text/issues/5831

BenjaminSchaaf avatar Jan 16 '23 01:01 BenjaminSchaaf