GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||
GeezerVison is showing github.com — Fix Property and ScriptBlock expressions in EntrySelectedBy tags within custom controls by SeeminglyScience · Pull Request #7913 · PowerShell/PowerShell Conversation
|
|
I think we need tests. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Patrick Meinecke (@SeeminglyScience) please add tests to Format-Custom.Tests.ps1. You can look at this as an example. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Steve Lee (@SteveL-MSFT) Sorry I saw your reply just a few minutes late. I've added tests, though they are in a different area. I'll go ahead and move them there. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| testing | ||
| '@ -replace '\r?\n', [Environment]::NewLine | ||
|
|
||
| $ps.Invoke()[0].Trim() | Should -BeExactly $expectedOutput |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Why index 0 and trim?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Index 0 because I know the collection will only have one item. It's mostly just habit from methods that could exist on the collection as well like ToString, I can remove it.
Trim because white space isn't important to the test, and it saves some white space when declaring the expected output. That's just cosmetic and can also be changed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I understand the habit, but prefer to remove the index. With regard to whitespace, I prefer to explicitly check for it as we had regressions previously with regard to whitespace in the output particularly with tables.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Steve Lee (@SteveL-MSFT) Please update your review. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Patrick Meinecke (@SeeminglyScience) Thanks for your contribution! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…in custom controls (PowerShell#7913) Send the current object when evaluating `EntrySelectedBy` in a custom control definition
…in custom controls (PowerShell#7913) Send the current object when evaluating `EntrySelectedBy` in a custom control definition
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
EntrySelectedBy in CustomControls do not pass on the current object to expressions
There was an error while loading. Please reload this page.