Skip to content

Commit

Permalink
Also adding file tests
Browse files Browse the repository at this point in the history
Adding Test Files for .ps1 and .psm1
  • Loading branch information
JackStuart committed Jan 18, 2025
1 parent 9923c3d commit c52c126
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 0 deletions.
17 changes: 17 additions & 0 deletions testdata/expected/file.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<#
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#>

Write-Output "Hello World"
36 changes: 36 additions & 0 deletions testdata/expected/file.psm1
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<#
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#>

function Get-HelloWorld {
<#
.SYNOPSIS
Outputs a "Hello, World!" message.
.DESCRIPTION
This function is a basic example to demonstrate how to create a PowerShell module.
.EXAMPLE
PS> Get-HelloWorld
Hello, World!
.NOTES
This is a demo function.
#>
Write-Output "Hello, World!"
}

# Export the function to make it available when the module is imported.
Export-ModuleMember -Function Get-HelloWorld
1 change: 1 addition & 0 deletions testdata/initial/file.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Write-Output "Hello World"
20 changes: 20 additions & 0 deletions testdata/initial/file.psm1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
function Get-HelloWorld {
<#
.SYNOPSIS
Outputs a "Hello, World!" message.
.DESCRIPTION
This function is a basic example to demonstrate how to create a PowerShell module.
.EXAMPLE
PS> Get-HelloWorld
Hello, World!
.NOTES
This is a demo function.
#>
Write-Output "Hello, World!"
}

# Export the function to make it available when the module is imported.
Export-ModuleMember -Function Get-HelloWorld

0 comments on commit c52c126

Please sign in to comment.