Fix Windows tests for long paths in `exec:environment:...`
This commit makes `Win32OperatingSystemTests >> testExec...`
more robust by testing the error code rather than text of
the exception which may change.
--- a/RegressionTests__Win32OperatingSystemTest.st Wed Nov 24 11:34:33 2021 +0000
+++ b/RegressionTests__Win32OperatingSystemTest.st Thu Aug 25 11:29:18 2022 +0100
@@ -5,6 +5,7 @@
COPYRIGHT (c) 2016 Jan Vrany
COPYRIGHT (c) 2021 svestkap
COPYRIGHT (c) 2021 Patrik Svestka
+ COPYRIGHT (c) 2022 Jan Vrany
All Rights Reserved
This software is furnished under a license and may be used
@@ -532,16 +533,14 @@
fork:true
newPgrp:false
inDirectory: Filename currentDirectory pathName
- ] raise: Exception
+ ] raise: OsError
suchThat: [ :ex |
savedException := ex.
- ex description includesString: 'File does not exist - CreateProcessW() has failed (File not found)'
+ ex errorSymbol == #'ERROR_FILE_NOT_FOUND'
].
- "/ the error is NOT proceedable
- self deny: savedException willProceed
"Created: / 21-10-2021 / 12:16:45 / svestkap"
- "Modified: / 26-11-2021 / 09:51:15 / Patrik Svestka <patrik.svestka@gmail.com>"
+ "Modified: / 25-08-2022 / 11:21:04 / jv"
!
testExecCreatedProcessError2
@@ -590,13 +589,11 @@
] raise: Exception
suchThat: [ :ex |
savedException := ex.
- ex description includesString: 'Invalid Arguments - commandLineUni16 exceeded size limit (4096 characters) (Invalid parameter)'.
+ ex errorSymbol == #'ERROR_INVALID_PARAMETER'
].
- "/ the exception is NOT proceedable
- self deny: savedException willProceed
"Created: / 21-10-2021 / 12:16:53 / svestkap"
- "Modified (comment): / 26-11-2021 / 09:49:21 / Patrik Svestka <patrik.svestka@gmail.com>"
+ "Modified: / 25-08-2022 / 11:22:06 / jv"
!
testExecWithTooLongCommandLine2
@@ -647,13 +644,11 @@
] raise: Exception
suchThat: [ :ex |
savedException := ex.
- ex description includesString: 'Invalid Arguments - commandPathUni16 exceeded size limit (4096 characters) (Invalid parameter)'.
+ ex errorSymbol == #'ERROR_INVALID_PARAMETER'
].
- "/ the error is NOT proceedable
- self deny: savedException willProceed
"Created: / 21-10-2021 / 12:18:26 / svestkap"
- "Modified (comment): / 26-11-2021 / 09:49:30 / Patrik Svestka <patrik.svestka@gmail.com>"
+ "Modified: / 25-08-2022 / 11:22:56 / jv"
!
testExecWithTooLongCommandPath2
@@ -704,13 +699,11 @@
] raise: Exception
suchThat: [ :ex |
savedException := ex.
- ex description includesString: 'Invalid Arguments - dirNameUni16 exceeded size limit (4096 characters) (Invalid parameter)'.
+ ex errorSymbol == #'ERROR_INVALID_PARAMETER'
].
- "/ the exception is NOT proceedable
- self deny: savedException willProceed
"Created: / 21-10-2021 / 12:22:38 / svestkap"
- "Modified (comment): / 26-11-2021 / 09:49:38 / Patrik Svestka <patrik.svestka@gmail.com>"
+ "Modified: / 25-08-2022 / 11:23:15 / jv"
!
testExecWithTooLongDirName2