Skip to content

Fixed uninitialized variable in the help function that was causing it to fail in strict mode#6781

Closed
BrucePay wants to merge 1 commit intoPowerShell:masterfrom
BrucePay:brucepay_HelpStrictMode
Closed

Fixed uninitialized variable in the help function that was causing it to fail in strict mode#6781
BrucePay wants to merge 1 commit intoPowerShell:masterfrom
BrucePay:brucepay_HelpStrictMode

Conversation

@BrucePay
Copy link
Copy Markdown
Collaborator

PR #Summary

Fix for #6497. Changed the "help" function in InitialSessionState.cs to initialize the problematic variable so the function won't fail.

PR Checklist

@BrucePay BrucePay requested a review from SteveL-MSFT April 30, 2018 23:11
@BrucePay BrucePay requested a review from daxian-dbw as a code owner April 30, 2018 23:11
@daxian-dbw
Copy link
Copy Markdown
Member

@BrucePay The PR #6059 is going to remove the more function. Shall we skip this PR and request #6059 to add the test from this PR?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo from, probably also remove the trailing punctuation which is inconsistent with general comments

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps: $help | Should -Not -BeEmptyOrNull instead? If it should fail, the test failure output may make it easier to understand what is going on

@BrucePay BrucePay force-pushed the brucepay_HelpStrictMode branch from 5b29ea2 to bca00c0 Compare May 1, 2018 18:09
Help
}
# the help function renders the help content as text so just verify that there is content
$help | Should -Not -BeNullOrEmpty $true
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the $true should not be needed.

describe 'test' {
   it 'failing test' {
       '' | should -not -BeNullOrEmpty
   }
   it 'passing test' {
       '' | should -BeNullOrEmpty
   }
 }

Copy link
Copy Markdown
Member

@TravisEz13 TravisEz13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment

@daxian-dbw
Copy link
Copy Markdown
Member

PR #6059 removes the more function and also includes this fix (test as well). So I will close this PR.

@daxian-dbw daxian-dbw closed this May 3, 2018
@BrucePay BrucePay deleted the brucepay_HelpStrictMode branch May 31, 2018 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants