Skip to content

Commit 00937cd

Browse files
committed
Test for background operator
1 parent e858587 commit 00937cd

File tree

1 file changed

+55
-27
lines changed

1 file changed

+55
-27
lines changed

Tests/syntax_test_PowerShell.ps1

Lines changed: 55 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -85,33 +85,61 @@ using namespace System.Management.Automation
8585
# ^^^^^^^ entity.name.label.powershell
8686
# ^ punctuation.definition.label.powershell
8787

88-
throw "Do not run this file!"
89-
# <- keyword.control.exception
90-
# ^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double
91-
92-
# Stop parsing
93-
& tool.exe /arg1 'value' /arg2 $value --% /arg3 $value /arg4 "value" # Comment
94-
# <- keyword.operator.call
95-
# ^^^^^^^^ variable.function
96-
# @@@@@@@@ reference
97-
# ^ punctuation.definition.parameter
98-
# ^^^^^ variable.parameter.option
99-
# ^ punctuation.definition.parameter
100-
# ^^^^^ variable.parameter.option
101-
# ^^^ keyword.control
102-
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted - constant - variable - comment
103-
104-
& gnutool.exe -s 'short option' --long-option --very_long_option value +plus-option
105-
#<- keyword.operator.call
106-
# ^^^^^^^^^^^ variable.function
107-
# @@@@@@@@@@@ reference
108-
# ^ variable.parameter.option punctuation.definition.parameter
109-
# ^ variable.parameter.option
110-
# ^^ variable.parameter.option punctuation.definition.parameter
111-
# ^^ variable.parameter.option punctuation.definition.parameter
112-
# ^^^^^^^^^^^^^^^^ variable.parameter.option
113-
# ^ variable.parameter.option punctuation.definition.parameter
114-
# ^^^^^^^^^^^ variable.parameter.option
88+
throw "Do not run this file!"
89+
# ^^^^^ keyword.control.exception.raise.powershell
90+
# ^^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.powershell string.quoted.double.powershell
91+
# ^ punctuation.definition.string.begin.powershell
92+
# ^ punctuation.definition.string.end.powershell
93+
94+
# Stop parsing
95+
& tool.exe /arg1 'value' /arg2 $value --% /arg3 $value /arg4 "value" # Comment
96+
# ^ keyword.operator.call.powershell
97+
# ^^^^^^^^ meta.function-call.powershell variable.function.powershell
98+
# @@@@@@@@ reference
99+
# ^^^^^ variable.parameter.option.powershell
100+
# ^ punctuation.definition.parameter.powershell
101+
# ^^^^^^^ meta.string.powershell string.quoted.single.powershell
102+
# ^ punctuation.definition.string.begin.powershell
103+
# ^ punctuation.definition.string.end.powershell
104+
# ^^^^^ variable.parameter.option.powershell
105+
# ^ punctuation.definition.parameter.powershell
106+
# ^^^^^^ variable.other.readwrite.powershell
107+
# ^ punctuation.definition.variable.powershell
108+
# ^^^ keyword.control.powershell
109+
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.powershell
110+
111+
& gnutool.exe -s 'short option' --long-option --very_long_option value +plus-option
112+
# ^ keyword.operator.call.powershell
113+
# ^^^^^^^^^^^ meta.function-call.powershell variable.function.powershell
114+
# @@@@@@@@@@@ reference
115+
# ^^ variable.parameter.option.powershell
116+
# ^ punctuation.definition.parameter.powershell
117+
# ^^^^^^^^^^^^^^ meta.string.powershell string.quoted.single.powershell
118+
# ^ punctuation.definition.string.begin.powershell
119+
# ^ punctuation.definition.string.end.powershell
120+
# ^^^^^^^^^^^^^ variable.parameter.option.powershell
121+
# ^^ punctuation.definition.parameter.powershell
122+
# ^^^^^^^^^^^^^^^^^^ variable.parameter.option.powershell
123+
# ^^ punctuation.definition.parameter.powershell
124+
# ^^^^^ string.unquoted.powershell
125+
# ^^^^^^^^^^^^ variable.parameter.option.powershell
126+
# ^ punctuation.definition.parameter.powershell
127+
128+
$job = Get-Process -Name pwsh &
129+
# ^^^^ variable.other.readwrite.powershell
130+
# ^ punctuation.definition.variable.powershell
131+
# ^ keyword.operator.assignment.powershell
132+
# ^^^^^^^^^^^ meta.function-call.powershell support.function.powershell
133+
# ^^^^^ variable.parameter.option.powershell
134+
# ^ punctuation.definition.parameter.powershell
135+
# ^^^^ string.unquoted.powershell
136+
# ^ keyword.operator.background.powershell
137+
Receive-Job $job -Wait
138+
# ^^^^^^^^^^^ meta.function-call.powershell support.function.powershell
139+
# ^^^^ variable.other.readwrite.powershell
140+
# ^ punctuation.definition.variable.powershell
141+
# ^^^^^ variable.parameter.option.powershell
142+
# ^ punctuation.definition.parameter.powershell
115143

116144
# Constants
117145
$true

0 commit comments

Comments
 (0)