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

negative symbol tests always fail #5405

Closed
jrappen opened this issue May 16, 2022 · 4 comments
Closed

negative symbol tests always fail #5405

jrappen opened this issue May 16, 2022 · 4 comments

Comments

@jrappen
Copy link
Contributor

jrappen commented May 16, 2022

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

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

<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
	<key>scope</key>
	<string><![CDATA[source.json meta.mapping.key - (meta.mapping.value meta.mapping.key | meta.sequence.list meta.mapping.key)]]></string>
	<key>settings</key>
	<dict>
		<key>showInSymbolList</key>
		<string>1</string>
		<key>showInIndexedSymbolList</key>
		<string>1</string>
	</dict>
</dict>
</plist>
// SYNTAX TEST "Packages/JSON/JSON.sublime-syntax"

// <- source.json

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

    "key-two":
//  @@@@@@@@@ definition
//  ^^^^^^^^^ meta.mapping.key - meta.mapping.value meta.mapping.key
    {
        "key-two-one": "value",
//      @@@@@@@@@@@@@ none
//      ^^^^^^^^^^^^^ meta.mapping.value meta.mapping.key
        "key-two-two": "value"
//      @@@@@@@@@@@@@ none
//      ^^^^^^^^^^^^^ meta.mapping.value meta.mapping.key
    }
}
// SYNTAX TEST "Packages/JSON/JSON.sublime-syntax"

// <- source.json

[
    {
        "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
Copy link
Contributor Author

jrappen commented May 17, 2022

Symbols test

Copy of docs from: #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 jrappen changed the title negative tests for symbols appear to be broken negative symbol tests always fail Sep 13, 2022
@BenjaminSchaaf BenjaminSchaaf self-assigned this Dec 15, 2022
@BenjaminSchaaf
Copy link
Member

Fixed in build 4147.

@jrappen
Copy link
Contributor Author

jrappen commented Dec 23, 2022

@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.

@BenjaminSchaaf
Copy link
Member

@jrappen I've made a new issue for the documentation here: #5831

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