Validate env unset
Authored by
mfwolffe <wolffemf@dukes.jmu.edu>
- SHA
c05bfe7e23a1fb7a607779a2ee1707a1634a9d43- Parents
-
a2f8ba3 - Tree
a02972b
c05bfe7
c05bfe7e23a1fb7a607779a2ee1707a1634a9d43a2f8ba3
a02972b| Status | File | + | - |
|---|---|---|---|
| M |
src/fgof_process.f90
|
5 | 0 |
| M |
test/test_validation.f90
|
5 | 0 |
src/fgof_process.f90modified@@ -130,6 +130,11 @@ contains | ||
| 130 | 130 | call set_error(res, FGOF_PROCESS_ERR_INVALID_OPTION, "env_unset entries must not be empty") |
| 131 | 131 | return |
| 132 | 132 | end if |
| 133 | + | |
| 134 | + if (index(options%env_unset(i), "=") > 0) then | |
| 135 | + call set_error(res, FGOF_PROCESS_ERR_INVALID_OPTION, "env_unset entries must use KEY format") | |
| 136 | + return | |
| 137 | + end if | |
| 133 | 138 | end do |
| 134 | 139 | end if |
| 135 | 140 | end if |
test/test_validation.f90modified@@ -30,4 +30,9 @@ program test_validation | ||
| 30 | 30 | opts%timeout_ms = -1 |
| 31 | 31 | res = run(shell_cmd, opts) |
| 32 | 32 | if (res%error_code /= FGOF_PROCESS_ERR_INVALID_OPTION) error stop "negative timeout should be invalid" |
| 33 | + | |
| 34 | + opts = process_options() | |
| 35 | + opts%env_unset = ["FGOF_PROCESS_TEST=hello"] | |
| 36 | + res = run(shell_cmd, opts) | |
| 37 | + if (res%error_code /= FGOF_PROCESS_ERR_INVALID_OPTION) error stop "env_unset entries with '=' should be invalid" | |
| 33 | 38 | end program test_validation |