+:rpfix_tests\r
+\r
+echo Testing rpfix junction\r
+md subdir\r
+echo 1 > subdir\file\r
+mklink /j junction subdir > nul\r
+cd ..\r
+wimlib-imagex capture in.dir test.wim > nul\r
+rd /s /q in.dir\r
+wimlib-imagex apply test.wim out.dir > nul\r
+echo 1 > tmp1\r
+type out.dir\junction\file > tmp2\r
+fc tmp1 tmp2 > nul\r
+if %errorlevel% neq 0 exit /b %errorlevel%\r
+rd /s /q out.dir\r
+del tmp1 tmp2\r
+md in.dir\r
+cd in.dir\r
+\r
+echo Testing rpfix exclude\r
+mklink otherlink c:\some\other\directory > nul\r
+cd ..\r
+wimlib-imagex capture in.dir test.wim > nul\r
+wimlib-imagex apply test.wim out.dir > nul\r
+rd out.dir\r
+if %errorlevel% neq 0 exit /b %errorlevel%\r
+rd /s /q in.dir\r
+md in.dir\r
+cd in.dir\r
+\r
+echo Testing rpfix relative\r
+echo 1 > file\r
+mklink relink file > nul\r
+call :do_test\r
+if %errorlevel% neq 0 exit /b %errorlevel%\r
+\r