incorrect assertions in test specs

オープン
#176 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
powershell
領域
testing-qa

調査の方向性

Start in spec/testfiles/syntax_test_TheBigTestFile.ps1 at the referenced ranges around lines 428, 569, 771, and 1181. Compare each assertion with the semantics described in issues #112, #62, and #132, then correct the misleading expectations and run the relevant spec tests to confirm the assertions match the grammar.

索引モデルが issue の本文から書いたものです。

説明

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

https://github.com/PowerShell/EditorSyntax/blob/44eac8702f3cbe55a4ec70c1fdb163d42b4162fc/spec/testfiles/syntax_test_TheBigTestFile.ps1#L428-L430

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

https://github.com/PowerShell/EditorSyntax/blob/44eac8702f3cbe55a4ec70c1fdb163d42b4162fc/spec/testfiles/syntax_test_TheBigTestFile.ps1#L569-L571

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.

https://github.com/PowerShell/EditorSyntax/blob/44eac8702f3cbe55a4ec70c1fdb163d42b4162fc/spec/testfiles/syntax_test_TheBigTestFile.ps1#L771-L776

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

https://github.com/PowerShell/EditorSyntax/blob/44eac8702f3cbe55a4ec70c1fdb163d42b4162fc/spec/testfiles/syntax_test_TheBigTestFile.ps1#L1181-L1187

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.

主要言語
PowerShell
スター
151
フォーク
55
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PowerShell/EditorSyntax のほかの issue

PowerShell/EditorSyntax の issue をすべて見る

似ている issue

Testing & QA の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。