Permalink
Browse files

some tests passed

  • Loading branch information...
1 parent 6e90760 commit f315249ae002de73390759011d7fb4d53ed2cba9 @camlspotter camlspotter committed Feb 14, 2013
Showing with 21 additions and 3 deletions.
  1. +2 −2 list2.ml
  2. +17 −1 search.ml
  3. +2 −0 searchTest.ml
View
@@ -1,6 +1,6 @@
(*************************************************************************)
(* *)
-(* Objective Caml LablTk library *)
+(* OCaml LablTk library *)
(* *)
(* Jacques Garrigue, Kyoto University RIMS *)
(* *)
@@ -12,7 +12,7 @@
(* *)
(*************************************************************************)
-(* $Id: list2.ml,v 1.9 2001/12/07 13:40:00 xleroy Exp $ *)
+(* $Id: list2.ml 11156 2011-07-27 14:17:02Z doligez $ *)
open StdLabels
View
@@ -21,7 +21,20 @@ let init_modules =
module Toploop = struct
open Config
+ open Misc
+
+let init_path () =
+ let dirs =
+ if !Clflags.use_threads then "+threads" :: !Clflags.include_dirs
+ else if !Clflags.use_vmthreads then "+vmthreads" :: !Clflags.include_dirs
+ else !Clflags.include_dirs in
+ let exp_dirs =
+ List.map (expand_directory Config.standard_library) dirs in
+ load_path := "" :: List.rev_append exp_dirs (Clflags.std_include_dir ());
+ Env.reset_cache ()
+
let set_paths () =
+ init_path ();
(* Add whatever -I options have been specified on the command line,
but keep the directories that user code linked in with ocamlmktop
may have added to load_path. *)
@@ -157,7 +170,10 @@ let lift f s =
+> List.map ~f:to_result
let search s modules paths =
- init modules paths; (* CR jfuruse: multiple calls of [search] accumulates load paths and others *)
+ (* CR jfuruse: multiple calls of [search] accumulates load paths and others.
+ In CGI multiple searches cannot happen, but in test, possible.
+ *)
+ init modules paths;
List.rev @@
ExtList.List.unique @@
List.rev @@
View
@@ -21,10 +21,12 @@ let _ = begin "search.ml" >::: [
kind = Value "sep:string -> string list -> string"}] @@
search "string list -> string" ["StdLabels"] []
end;
+ (* CR jfuruse: We fail here *)
"type" >:: begin fun () ->
ok {id=["String"; "t"]; kind = Type "string"} @@
List.nth (search "t" ["String"] []) 1
end;
+ (* CR jfuruse: We fail here *)
"module" >:: begin fun () ->
ok [{id=["String"]; kind = Module}] @@
search "String" ["String"] []

0 comments on commit f315249

Please sign in to comment.