Skip to content

Commit 1fef4d3

Browse files
More tweaks
1 parent 86b40de commit 1fef4d3

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

bin/test.ps1

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ function Enable-All-UnitTests($BuildDir) {
5151
function Test-Refactoring-Projects($PracticeExercisesDir) {
5252
Write-Output "Testing refactoring projects"
5353
@("tree-building", "ledger", "markdown") | ForEach-Object {
54-
Invoke-Tests -Path "$PracticeExercisesDir/$_"
54+
Invoke-Tests -Path "${PracticeExercisesDir}/${_}"
5555
}
5656
}
5757

5858
function Set-ExampleImplementation {
5959
[CmdletBinding(SupportsShouldProcess)]
6060
param($ExercisesDir, $ReplaceFileName)
6161

62-
if ($PSCmdlet.ShouldProcess("Exercise $ReplaceFileName", "replace solution with example")) {
62+
if ($PSCmdlet.ShouldProcess("Exercise ${ReplaceFileName}", "replace solution with example")) {
6363
Get-ChildItem -Path $ExercisesDir -Include "*.csproj" -Recurse | ForEach-Object {
6464
$stub = Join-Path -Path $_.Directory ($_.BaseName + ".cs")
6565
$example = Join-Path -Path $_.Directory ".meta" $ReplaceFileName
@@ -88,33 +88,33 @@ function Test-ExerciseImplementation($Exercise, $BuildDir, $ConceptExercisesDir,
8888
if (-Not $Exercise) {
8989
Invoke-Tests -Path $BuildDir -IsCI $IsCI
9090
}
91-
elseif (Test-Path "$ConceptExercisesDir/$Exercise") {
92-
Invoke-Tests -Path "$ConceptExercisesDir/$Exercise" -IsCI $IsCI
91+
elseif (Test-Path "${ConceptExercisesDir}/${Exercise}") {
92+
Invoke-Tests -Path "${ConceptExercisesDir}/${Exercise}" -IsCI $IsCI
9393
}
94-
elseif (Test-Path "$PracticeExercisesDir/$Exercise") {
95-
Invoke-Tests -Path "$PracticeExercisesDir/$Exercise" -IsCI $IsCI
94+
elseif (Test-Path "${PracticeExercisesDir}/${Exercise}") {
95+
Invoke-Tests -Path "${PracticeExercisesDir}/${Exercise}" -IsCI $IsCI
9696
}
9797
else {
98-
throw "Could not find exercise '$Exercise'"
98+
throw "Could not find exercise '${Exercise}'"
9999
}
100100
}
101101

102102
function Invoke-Tests($Path, $IsCI) {
103103
if ($IsCI) {
104104
Get-ChildItem -Path $Path -Include "*.csproj" -Recurse | ForEach-Object {
105-
& dotnet add $_.FullName package JunitXml.TestLogger -n -v 3.0.134
105+
& dotnet add $_.FullName package JunitXml.TestLogger -v 4.1.0
106106
}
107107
& dotnet test $Path --logger "junit;LogFilePath=results/test.xml"
108108
}
109109
else {
110-
& dotnet test "$Path"
110+
& dotnet test $Path
111111
}
112112
}
113113

114114

115-
$buildDir = Join-Path $PSScriptRoot "build"
116-
$practiceExercisesDir = Join-Path $buildDir "practice"
117-
$conceptExercisesDir = Join-Path $buildDir "concept"
115+
$buildDir = "${PSScriptRoot}/build"
116+
$practiceExercisesDir = "${buildDir}/practice"
117+
$conceptExercisesDir = "${buildDir}/concept"
118118
$sourceDir = Resolve-Path "exercises"
119119
$isCi = [System.Convert]::ToBoolean($env:CI)
120120

0 commit comments

Comments
 (0)