From 8d239d097527a5f5762fc1334c6aef93f3110d0a Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Mon, 23 Oct 2023 15:58:26 -0400 Subject: [PATCH] add test --- .../TestPSScriptFile.Tests.ps1 | 7 ++++ ...riptWithWhitespaceBeforeClosingComment.ps1 | 42 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 test/testFiles/testScripts/ScriptWithWhitespaceBeforeClosingComment.ps1 diff --git a/test/PSScriptFileInfoTests/TestPSScriptFile.Tests.ps1 b/test/PSScriptFileInfoTests/TestPSScriptFile.Tests.ps1 index b667e317e..47da1dfea 100644 --- a/test/PSScriptFileInfoTests/TestPSScriptFile.Tests.ps1 +++ b/test/PSScriptFileInfoTests/TestPSScriptFile.Tests.ps1 @@ -88,4 +88,11 @@ Describe "Test Test-PSScriptFileInfo" -tags 'CI' { Test-PSScriptFileInfo $scriptFilePath | Should -Be $true } + + It "determine script with whitespace before closing comment is valid" { + $scriptName = "ScriptWithWhitespaceBeforeClosingComment.ps1" + $scriptFilePath = Join-Path $script:testScriptsFolderPath -ChildPath $scriptName + + Test-PSScriptFileInfo $scriptFilePath | Should -Be $true + } } diff --git a/test/testFiles/testScripts/ScriptWithWhitespaceBeforeClosingComment.ps1 b/test/testFiles/testScripts/ScriptWithWhitespaceBeforeClosingComment.ps1 new file mode 100644 index 000000000..c0e06af8b --- /dev/null +++ b/test/testFiles/testScripts/ScriptWithWhitespaceBeforeClosingComment.ps1 @@ -0,0 +1,42 @@ + +<#PSScriptInfo + +.VERSION 1.0 + +.GUID 3951be04-bd06-4337-8dc3-a620bf539fbd + +.AUTHOR annavied + +.COMPANYNAME + +.COPYRIGHT + +.TAGS + +.LICENSEURI + +.PROJECTURI + +.ICONURI + +.EXTERNALMODULEDEPENDENCIES + +.REQUIREDSCRIPTS + +.EXTERNALSCRIPTDEPENDENCIES + +.RELEASENOTES + + +.PRIVATEDATA + +#> + +<# + +.DESCRIPTION + this is a test for a script that will be published remotely + + #> +Param() +