-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInvoke-Test.ps1
62 lines (38 loc) · 1.15 KB
/
Invoke-Test.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<#PSScriptInfo
.VERSION 1.0
.GUID eef73233-86d1-4564-8cfd-1495effdad75
.AUTHOR jdfenw@gmail.com
.COMPANYNAME John D. Fisher
.COPYRIGHT 2024 John D. Fisher
.TAGS
.LICENSEURI https://github.com/jfishe/ctags_markdown/blob/main/LICENSE
.PROJECTURI https://github.com/jfishe/ctags_markdown
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES
.PRIVATEDATA
#>
<#
.DESCRIPTION
Invoke ctags and compare expected tags file.
#>
[CmdletBinding()]
Param()
$exe = Get-Command 'ctags'
$PathCtags = Get-Item -Path "$PSScriptRoot\ctags.d"
$PathTest = Get-ChildItem -Path "$PSScriptRoot\tests\*.md"
$Parameters = @(
"--options=$PathCtags",
"--sort=no"
)
foreach ($item in $PathTest) {
$TagsOut = "$($item.Directory)\$($item.BaseName)"
&$exe $Parameters -o "$TagsOut.tags" $item 2> "$TagsOut.out"
$ReferenceObject = Get-Content -Path "$TagsOut.tags"
$DifferenceObject = Get-Content -Path "$TagsOut.expectedtags"
Write-Verbose "${TagsOut}.tags"
Write-Verbose "${TagsOut}.expectedtags"
Compare-Object -ReferenceObject $ReferenceObject -DifferenceObject $DifferenceObject
}