ounit
ounit copied to clipboard
add ~env_export to assert_command
This feature request has been migrated from artifact #1150 on forge.ocamlcore.org. It was assigned to user102.
user102 posted on 2012-05-09 23:03:09:
Something that allow to really export like in standard sh:
let env_export nm vl env =
let replaced = ref false in
for i = 0 to Array.length env - 1 do
if OASISString.starts_with ~what:(nm^"=") env.(i) then
begin
env.(i) <- nm^"="^vl;
replaced := true
end
done;
if not !replaced then
Array.append env [|nm^"="^vl|]
else
env
in