package pfff

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file unit_analyze_java.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
open OUnit

(*****************************************************************************)
(* Prelude *)
(*****************************************************************************)

let unittest = 
"foundation_java" >::: [

(*****************************************************************************)
(* Tags *)
(*****************************************************************************)
(*
 "tags_java" >::: [

   "basic tags" >:: (fun () ->
     let file_content = "
       package foo;
       class Bar { }
     " in
     let tmpfile = Parse_java.tmp_file_from_string file_content in
     let tags = Tags_java.defs_of_dir_or_file ~verbose:false tmpfile [] in
        (match tags with
        | [file, tags_in_file] ->
            assert_equal tmpfile file;
            let xs = tags_in_file +> List.map (fun x ->
              x.Tags_file.tagname, x.Tags_file.kind
            ) in
            assert_equal ~msg:"it should contain the right 6 entries" [
              "foo.Bar", E.Class E.RegularClass;
            ]
            xs
        | _ ->
            assert_failure "The tags should contain only one entry for one file"
        )
   );
 ]
*)

(*---------------------------------------------------------------------------*)
(* Final suite *)
(*---------------------------------------------------------------------------*)
]
OCaml

Innovation. Community. Security.