8 Array.of_list @@ String.nsplit ("./foo " ^ y) " " in
9 assert_equal ~printer:Std.dump x @@ f @@ snd @@ parse argv
11 let _ = begin "cmdOpt.ml" >::: [
12 "filename" >:: begin fun () ->
13 assert_equal ["foo"] @@ fst @@ parse [| "./foo"; "foo" |];
14 assert_equal ["foo"; "bar"] @@ fst @@ parse [| "./foo"; "foo"; "bar" |]
16 "size" >:: begin fun () ->
17 ok (100,200) (fun t -> t#size) "-W 100 -H 200";
18 ok (100,200) (fun t -> t#size) "--width=100 --height=200";
20 "color" >:: begin fun () ->
21 ok (1,2,3) (fun t -> t#color) "--red=1 --green=2 --blue=3"
23 "main class" >:: begin fun () ->
24 ok "boot.Boot" (fun t -> t#main_class) "";
25 ok "foo" (fun t -> t#main_class) "-m foo";
26 ok "foo" (fun t -> t#main_class) "--main=foo"
28 "out" >:: begin fun () ->
29 ok "a.swf" (fun t -> t#output) "";
30 ok "foo.swf" (fun t -> t#output) "-o foo.swf";
31 ok "foo.swf" (fun t -> t#output) "--output=foo.swf"
33 ] end +> run_test_tt_main