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

incorrect assertions in test specs #176

Open
msftrncs opened this issue May 15, 2019 · 0 comments
Open

incorrect assertions in test specs #176

msftrncs opened this issue May 15, 2019 · 0 comments

Comments

@msftrncs
Copy link
Contributor

msftrncs commented May 15, 2019

This is to point out some incorrect assertions in the spec tests.

3++2
# ^ ^^ constant.numeric.integer.powershell
# ^ keyword.operator.assignment.powershell

The ++ is actually the unary increment operator, and PowerShell will flag this as an error because it cannot be used on a constant.
image

# Commands (Built-in variables)
ls *.ps1 -recurse
# ^ ^ keyword.operator.assignment.powershell

These are not operators in these instances, so even though the grammar scopes them as such, asserting these tests is misleading and will require correcting when the grammar is improved. This is covered in issue #112.

$roman | c:\users\Me\Documents\Programming\F#\test.exe $roman
# ^ punctuation.definition.variable.powershell
# ^ variable.other.readwrite.powershell
# ^ keyword.operator.other.powershell
# ^ punctuation.definition.comment.powershell
# ^ ^ comment.line.powershell

The # is this spec is not a line comment token. Its actually part of an unquoted non-expanding string that describes a function/command name. This is covered in issue #62.

(Example under PR #156)
image

$file = join-path $env:SystemDrive "$([System.io.path]::GetRandomFileName()).ps1"
# <- punctuation.definition.variable.powershell
# ^ support.function.powershell
# ^ support.variable.drive.powershell
# ^ variable.other.readwrite.powershell
# ^ string.quoted.double.powershell punctuation.definition.variable.powershell
# ^ storage.type.powershell

Line 1186 specs the $ as definition.variable. This is covered in issue #132.

(Example under PR #156 I have scoped it as punctuation.section.embedded.begin)
image

This might only be a partial listing. This is some of the specs I am constantly looking at when checking my work. I list these more so that others can avoid needing to question these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant