incorrect assertions in test specs

Đang mở
#176 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
powershell
Lĩnh vực
testing-qa

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
PowerShell
Star
151
Fork
55
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PowerShell/EditorSyntax

Tất cả issue của PowerShell/EditorSyntax

Issue tương tự

Thêm issue về Testing & QA

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.