| 1 |
program test_command |
| 2 |
use fgof_process, only : FGOF_PROCESS_MODE_ARGV, command, process_command |
| 3 |
implicit none |
| 4 |
|
| 5 |
type(process_command) :: cmd |
| 6 |
|
| 7 |
cmd = command("printf", ["hello", "world"]) |
| 8 |
|
| 9 |
if (cmd%mode /= FGOF_PROCESS_MODE_ARGV) error stop "mode mismatch" |
| 10 |
if (.not. allocated(cmd%program)) error stop "program not allocated" |
| 11 |
if (cmd%program /= "printf") error stop "program mismatch" |
| 12 |
if (.not. allocated(cmd%argv)) error stop "argv not allocated" |
| 13 |
if (size(cmd%argv) /= 2) error stop "argv size mismatch" |
| 14 |
if (cmd%argv(1) /= "hello") error stop "argv(1) mismatch" |
| 15 |
if (cmd%argv(2) /= "world") error stop "argv(2) mismatch" |
| 16 |
end program test_command |
| 17 |
|