Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusStorhaug committed Apr 14, 2024
1 parent 6a6c4ae commit 32af7cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/tests/PSModule/SourceCode.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ Describe 'PSModule - SourceCode tests' {
It 'Script filename and function/filter name should match' {
$issues = @('')
$functionFiles | ForEach-Object {
$path = $_.FullName
$filePath = $_.FullName
$fileName = $_.BaseName
$relativePath = $path.Replace($Path, '').Trim('\').Trim('/')
$Ast = [System.Management.Automation.Language.Parser]::ParseFile($path, [ref]$null, [ref]$null)
$relativePath = $filePath.Replace($Path, '').Trim('\').Trim('/')
$Ast = [System.Management.Automation.Language.Parser]::ParseFile($filePath, [ref]$null, [ref]$null)
$tokens = $Ast.FindAll( { $args[0] -is [System.Management.Automation.Language.FunctionDefinitionAst] } , $true )
if ($tokens.Name -ne $fileName) {
$issues += " - $relativePath - $($tokens.Name)"
Expand Down

0 comments on commit 32af7cb

Please sign in to comment.