From d5a08bf9743a88528869c463a8edc178b59b05cd Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 15 Jun 2026 15:35:37 +0200 Subject: test.ps1: add a test for nt_namespace --- scripts/test.ps1 | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/scripts/test.ps1 b/scripts/test.ps1 index fc97e29..e933c06 100644 --- a/scripts/test.ps1 +++ b/scripts/test.ps1 @@ -71,14 +71,39 @@ function Verify-ExchangeInts { [int] $OldInt ) - $old_int = Invoke-Exe { exchange_ints.exe $NewInt } - if ($old_int -ne $OldInt) { - throw "Expected $OldInt, got: $old_int" + $actual = Exchange-Ints $NewInt + if ($actual -ne $OldInt) { + throw "Expected $OldInt, got: $actual" } else { - Write-Host "Previous integer: $old_int, new integer: $NewInt" + Write-Host "Previous integer: $actual, new integer: $NewInt" } } +function Convert-NTPath { + param( + [Parameter(Mandatory=$true)] + [string] $NTPath + ) + + return Invoke-Exe { convert_nt_path.exe $NTPath } +} + +function Verify-ConvertNTPath { + param( + [Parameter(Mandatory=$true)] + [string] $NTPath, + [Parameter(Mandatory=$true)] + [string] $Expected + ) + + $actual = Convert-NTPath $NTPath + if ($actual -ne $expected) { + throw "Expected $expected, got: $actual" + } + Write-Host "NT path: $NTPath" + Write-Host "DOS path: $actual" +} + function Run-ProjectTests { param( [Parameter(Mandatory=$true)] @@ -97,6 +122,7 @@ function Run-ProjectTests { Verify-ExchangeInts -NewInt 69 -OldInt 42 Verify-ExchangeInts -NewInt 100500 -OldInt 69 + Verify-ConvertNTPath \DosDevices\C:\Windows C:\Windows foreach ($driver in $drivers) { Stop-Driver -DriverName $driver -- cgit v1.3