ounit icon indicating copy to clipboard operation
ounit copied to clipboard

add ~env_export to assert_command

Open gildor478 opened this issue 4 years ago • 0 comments

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

gildor478 avatar Oct 24 '20 16:10 gildor478