Skip to content

Commit 2b54a41

Browse files
committed
Minor tweaks to tests (one actual fix on line 137)
1 parent 8d4ae61 commit 2b54a41

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

bin/test-file.ps1

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
1+
throw "NEVER RUN THIS FILE!"
22
### New PowerShell 4 stuff:
33

44
# the undiscoverable foreach
55
@("any","array","has").foreach({ $_ })
6-
@("any","array","has").foreach{ $_ }
6+
@('any','array','has').foreach{ $_ }
77

88
# the undiscoverable where
99
@("any","array","has").where({ $_.Length -gt 3 })
@@ -25,7 +25,7 @@ Configuration Crazyness {
2525

2626
### PowerShell 3 and older:
2727

28-
# st: trimTrailingWhiteSpaceOnSave false
28+
# st: trimTrailingWhiteSpaceOnSave false
2929
<#
3030
Let's see what embedded docs in comments look like...
3131
TODO: inside here, .<tab> should present list of doc keywords
@@ -134,13 +134,16 @@ string.'
134134
"Although obviously in a $($subexpression.Length) it should be!"
135135

136136
# TODO: can we highlight this as an error?
137-
if(!($PSVersionTable.PSVersion -ge '3.0') {
137+
if(!($PSVersionTable.PSVersion -ge '3.0')) {
138138
# In PowerShell 3, this will cause an ERROR
139139
"In PowerShell 2 we could $drive: to add a colon"
140140
}
141141

142-
"This is deeply nested: $( stuff-here | %{ why-would { $( ("you, do this)) anyway") ) } } )"
143-
"When you call a method: $( stuff-here | %{ Invoke-Expression $( [statictype]::method("Like (this") ) $var } )"
142+
function get-numbers { 1..3 }
143+
# NOTE: PowerShell can't actually parse this line correctly:
144+
"This is deeply nested: $( get-number | %{ invoke-command { $(("you, do this)) anyway")) } } )"
145+
146+
"When you call a method: $( get-number | %{ invoke-command $( [string]::format("Like (this{0})","what?") ) $var } )"
144147
# " <-- this stops the string above, until we fix the parenthesis on methods.
145148
# TODO: Highlight member access
146149
# TODO: Highlight array access

0 commit comments

Comments
 (0)