text
stringlengths
0
601k
let string_of_char = String . make 1
let maybe_quote f = if String . contains f ' ' || String . contains f ' " ' \ || String . contains f ' \ t ' || f = " " then Filename . quote f else f
let words s = let l = String . length s in let rec f quote w ws i = if i >= l then begin if w " " <> then List . rev ( w :: ws ) else List . rev ws end else begin let j = i + 1 in match s . [ i ] with | ' ' ' \ -> f ( not quote ) w ws j | ' ' -> begin if quote then f true ( w ^ ( string_of_char ' ' ) ) ws j else begin ...
let file_is_empty filename = let ic = open_in filename in let filesize = in_channel_length ic in close_in ic ; filesize = 0
let string_of_location loc = let buf = Buffer . create 64 in let fmt = Format . formatter_of_buffer buf in Location . print_loc fmt loc ; Format . pp_print_flush fmt ( ) ; Buffer . contents buf
let run_system_command command = match Sys . command command with | 0 -> ( ) | _ as exitcode -> Printf . eprintf " Sysem command % s failed with status % d \ n " %! command exitcode ; exit 3
let mkdir dir = if not ( Sys . file_exists dir ) then let quoted_dir = " " " \ ^ dir ^ " " " \ in run_system_command ( " mkdir " ^ quoted_dir )
let rec make_directory dir = if Sys . file_exists dir then ( ) else ( make_directory ( Filename . dirname dir ) ; mkdir dir )
let string_of_file filename = let chan = open_in_bin filename in let filesize = in_channel_length chan in if filesize > Sys . max_string_length then begin close_in chan ; failwith ( " The file " ^ filename ^ " is too large to be loaded into a string " ) end else begin let result = try really_input_string chan filesize ...
let with_input_file ( ? bin = false ) x f = let ic = ( if bin then open_in_bin else open_in ) x in try let res = f ic in close_in ic ; res with e -> ( close_in ic ; raise e )
let with_output_file ( ? bin = false ) x f = let oc = ( if bin then open_out_bin else open_out ) x in try let res = f oc in close_out oc ; res with e -> ( close_out oc ; raise e )
let copy_chan ic oc = let m = in_channel_length ic in let m = ( m lsr 12 ) lsl 12 in let m = max 16384 ( min Sys . max_string_length m ) in let buf = Bytes . create m in let rec loop ( ) = let len = input ic buf 0 m in if len > 0 then begin output oc buf 0 len ; loop ( ) end in loop ( )
let copy_file src dest = with_input_file ~ bin : true src begin fun ic -> with_output_file ~ bin : true dest begin fun oc -> copy_chan ic oc end end
type ' a future = ' a Deferred . t
let catch f g = try_with ~ extract_exn : true f >>= function | Ok y -> return y | Error exn -> g exn
let fail exn = Error . raise ( Error . of_exn exn )
let or_fail = function | Ok x -> return x | Error ( # Caqti_error . t as err ) -> Error . raise ( Error . of_exn ( Caqti_error . Exn err ) )
let ( ) >>=? m f = m >>= ( function Ok x -> f x | Error _ as r -> return r )
let ( ) >|=? m f = m >|= ( function Ok x -> Ok ( f x ) | Error _ as r -> r )
module Alcotest_cli = Testlib . Make_alcotest_cli ( Alcotest . Unix_platform ) ( struct include Deferred let bind m f = bind m ~ f let catch f g = try_with ~ extract_exn : true f >>= function | Ok y -> return y | Error exn -> g exn end )
module List_result_future = struct let rec iter_s f = function | [ ] -> return ( Ok ( ) ) | x :: xs -> f x >>=? fun ( ) -> iter_s f xs end
let tests = let ver = OASISVersion . version_of_string in let mk_base ( ? v = NoVersion ) ? e lic = ( DEP5Unit { license = lic ; version = v ; excption = e ; } ) in let mk ? v ? e lic = Some ( DEP5License ( mk_base ? v ? e lic ) ) in " License " >::: ( List . map ( fun ( txt , res ) -> txt >:: ( fun test_ctxt -> match ...
let with_temp_file f = let path = Filename . temp_file ( Filename . basename Sys . argv . ( 0 ) ) " volume " in ignore_string ( run " dd " [ " if =/ dev / zero " ; " of " = ^ path ; " seek = 1024 " ; " bs = 1M " ; " count = 1 " ] ) ; finally ( fun ( ) -> f path ) ( fun ( ) -> rm_f path )
let with_temp_volume path f = let dev = ignore_string ( run " losetup " [ " - f " ; path ] ) ; let line = run " losetup " [ " - j " ; path ] in try let i = String . index line ' ' in String . sub line 0 ( i - 1 ) with e -> error " Failed to parse output of losetup - j : [ % s ] " line ; ignore_string ( run " losetup " ...
let dev_mapper_path = " / tmp " / ^ name
let create_dev_mapper_path ( ) = ( try Unix . unlink dev_mapper_path with _ -> ( ) ) ; mknod name dev_mapper_path 0o0644
let create_destroy ( ) = with_temp_file ( fun tmp -> with_temp_volume tmp ( fun device -> create name [ ] ; finally ( fun ( ) -> let all = ls ( ) in stat name |> ignore ; if not ( List . mem name all ) then failwith ( Printf . sprintf " % s not in [ % s ] " name ( String . concat " ; " all ) ) ) ( fun ( ) -> remove nam...
let constant_sector c = let sector = Cstruct . create 512 in for i = 0 to Cstruct . len sector - 1 do Cstruct . set_uint8 sector i c done ; sector
let read_sector path sector = let open Lwt in let offset = Int64 . mul sector 512L in let buf = constant_sector 9 in let t = Lwt_unix . openfile path [ Lwt_unix . O_RDONLY ] 0 >>= fun fd -> Lwt_unix . LargeFile . lseek fd offset Unix . SEEK_SET >>= fun _ -> Lwt_cstruct . complete ( Lwt_cstruct . read fd ) buf >>= fun (...
let write_sector path sector buf = let open Lwt in let offset = Int64 . mul sector 512L in let t = Lwt_unix . openfile path [ Lwt_unix . O_WRONLY ] 0 >>= fun fd -> Lwt_unix . LargeFile . lseek fd offset Unix . SEEK_SET >>= fun _ -> Lwt_cstruct . complete ( Lwt_cstruct . write fd ) buf >>= fun ( ) -> Lwt_unix . close fd...
let cstruct_equal a b = let check_contents a b = for i = 0 to Cstruct . len a - 1 do let a ' = Cstruct . get_uint8 a i in let b ' = Cstruct . get_uint8 b i in if a ' <> b ' then failwith ( Printf . sprintf " buffers differ at % d : % d <> % d " i a ' b ' ) done in if Cstruct . len a <> ( Cstruct . len b ) then failwith...
let write_read ( ) = with_temp_file ( fun tmp -> let ones = constant_sector 1 in let twos = constant_sector 2 in write_sector tmp 0L ones ; write_sector tmp 1L twos ; with_temp_volume tmp ( fun path -> let device = Location . Path path in let targets = [ Target . ( { start = 0L ; size = 1L ; kind = Linear Location . ( ...
let write_read_reload ( ) = with_temp_file ( fun tmp -> let ones = constant_sector 1 in let twos = constant_sector 2 in write_sector tmp 0L ones ; write_sector tmp 1L twos ; with_temp_volume tmp ( fun path -> let device = Location . Path path in let targets = [ Target . ( { start = 0L ; size = 1L ; kind = Linear Locati...
let write_read_striped ( ) = with_temp_file ( fun tmp1 -> let ones = constant_sector 1 in write_sector tmp1 0L ones ; with_temp_file ( fun tmp2 -> let twos = constant_sector 2 in write_sector tmp2 0L twos ; with_temp_volume tmp1 ( fun path1 -> with_temp_volume tmp2 ( fun path2 -> let device1 = Location . Path path1 in ...
let finally f g = try let result = f ( ) in g ( ) ; result with e -> g ( ) ; raise e
let ls ( ) = let ( _ : string list ) = ls ( ) in ( )
let stat_none ( ) = match stat " namethatdoesnotexist " with | None -> ( ) | Some _ -> failwith " stat_none : got Some rather than None "
let _ = ( try remove name with _ -> ( ) )
let suite = " devicemapper " >::: [ " ls " >:: ls ; " create_destroy " >:: create_destroy ; " write_read " >:: write_read ; " write_read_reload " >:: write_read_reload ; " write_read_striped " >:: write_read_striped ; " stat_none " >:: stat_none ; ]
let pluginloader = Conf . make_exec " pluginloader "
let datadir = FilePath . make_filename [ " src " ; " ext " ; " plugin - loader " ; " test " ; " data " ]
let findlibdir = FilePath . concat datadir " findlib "
let setup_findlib test_ctxt = let dn = bracket_tmpdir test_ctxt in let builddir = FilePath . make_absolute ( FileUtil . pwd ( ) ) " _build " in let buildfindlibdir = FilePath . concat builddir findlibdir in let findlibdir = FilePath . make_absolute ( FileUtil . pwd ( ) ) findlibdir in let copy_to_dn fn_dir fn = let tgt...
let assert_pluginloader test_ctxt dn args = let buf = Buffer . create 13 in let lst = ref [ ] in let ocamlpath = try FilePath . string_of_path ( ( FilePath . path_of_string ( Sys . getenv " OCAMLPATH " ) ) @ [ dn ] ) with Not_found -> dn in let env = Array . append [ " | OCAMLPATH " =^ ocamlpath ] | ( Unix . environmen...
let ( ) = run_test_tt_main ( " PluginLoader " >::: [ " list " >:: ( fun test_ctxt -> let dn = setup_findlib test_ctxt in let lst = assert_pluginloader test_ctxt dn [ ] in assert_equal ~ printer ( : String . concat " , " ) [ " plugin1 : first plugin " ; " plugin2 : second plugin " ; " plugin3 : third plugin " ; " " ] ls...
let n = " h " and s = " c " ;
let _loc = FanLoc . ghost ; # default_quotation " expr " ; ;
let f x = { : expr | $ tup : x } ; |
let u x y = { : expr | $ lid : x $ y } ; |
let a_should_be_present = B + 2 ; print_int ( a_should_be_present + 1 ) ; ENDIF ; print_int ( a_should_be_present + 3 ) ; ENDIF ; print_int ( a_should_be_present + 4 ) ; IFDEF D THEN print_int a ; ELSE print_bool 3 ; ENDIF ; ELSE print_int ( c_should_not_be_present + 1 ) ; ENDIF ; print_int ( c_should_not_be_present + ...
let e = IFDEF DNE THEN print_int ( c_should_not_be_present + 2 ) ELSE print_int ( A * a_should_be_present + 5 ) ENDIF ;
let f = fun _ -> IFDEF DNE THEN print_int ( c_should_not_be_present + 2 ) ELSE print_int ( A * a_should_be_present + 5 ) ENDIF ; DEFINE Z = " ok " ; ELSE DEFINE Z = " ko " ; ENDIF ; Z ; DEFINE Z = " ko2 " ; ELSE DEFINE Z = " ok2 " ; ENDIF ; Z ; pouet ;
module M = Map . Make ( struct type t = int let compare ( x : t ) y = compare x y end )
let img x m = try Some ( M . find x m ) with Not_found -> None
let check msg cond = if not ( List . for_all cond testvals ) then Printf . printf " Test % s FAILED \ n " %! msg
let checkbool msg b = if not b then Printf . printf " Test % s FAILED \ n " %! msg
let uncurry ( f : ' a -> ' b -> ' c ) ( x , y : ' a * ' b ) : ' c = f x y
let test x v s1 s2 = checkbool " is_empty " ( M . is_empty s1 = List . for_all ( fun i -> img i s1 = None ) testvals ) ; check " mem " ( fun i -> M . mem i s1 = ( img i s1 <> None ) ) ; check " add " ( let s = M . add x v s1 in fun i -> img i s = ( if i = x then Some v else img i s1 ) ) ; check " singleton " ( let s = ...
let rkey ( ) = Random . int 10
let rdata ( ) = Random . float 1 . 0
let rmap ( ) = let s = ref M . empty in for i = 1 to Random . int 10 do s := M . add ( rkey ( ) ) ( rdata ( ) ) ! s done ; ! s
let _ = Random . init 42 ; for i = 1 to 10000 do test ( rkey ( ) ) ( rdata ( ) ) ( rmap ( ) ) ( rmap ( ) ) done
let ( ) = let m1 = ref M . empty in for i = 1 to 10 do m1 := M . add i ( float i ) ! m1 done ; let m2 = ref ! m1 in let a0 = Gc . allocated_bytes ( ) in let a1 = Gc . allocated_bytes ( ) in for i = 11 to 30 do m2 := M . remove i ! m2 done ; let a2 = Gc . allocated_bytes ( ) in assert ( ! m2 == ! m1 ) ; assert ( a2 . - ...
let ( ) = let m1 = ref M . empty in for i = 1 to 10 do m1 := M . add i ( float i ) ! m1 done ; let m2 = M . filter ( fun e _ -> e >= 0 ) ! m1 in assert ( m2 == ! m1 )
let ( ) = let m1 = ref M . empty in let tmp = ref None in for i = 1 to 10 do tmp := Some ( float i ) ; m1 := M . add i ! tmp ! m1 done ; let m2 = ref ! m1 in let a0 = Gc . allocated_bytes ( ) in let a1 = Gc . allocated_bytes ( ) in m2 := M . add 10 ! tmp ! m2 ; let a2 = Gc . allocated_bytes ( ) in assert ( ! m2 == ! m1...
let with_setup name fn = let material = RTCMaterial . build ( ) in let point = RTCTuple . point 0 . 0 . 0 . in name >:: ( fn material point )
let identity x = x
let tests = " Materials " >::: [ " The default material " >:: ( fun test_ctxt -> let m = RTCMaterial . build ( ) in assert ( RTCColor . equal m . color ( RTCColor . build 1 . 1 . 1 . ) ) ; assert_equal m . ambient 0 . 1 ; assert_equal m . diffuse 0 . 9 ; assert_equal m . specular 0 . 9 ; assert_equal m . shininess 200 ...
let tests = " Matrix " >::: [ " Constructing and inspecting a 4x4 matrix " >:: ( fun test_ctxt -> let m = [ | [ | 1 . ; 2 . ; 3 . ; 4 . ] ; | [ | 5 . 5 ; 6 . 5 ; 7 . 5 ; 8 . 5 ] ; | [ | 9 . ; 10 . ; 11 . ; 12 . ] ; | [ | 13 . 5 ; 14 . 5 ; 15 . 5 ; 16 . 5 ] | ] | in assert_equal 1 . m . ( 0 ) . ( 0 ) ; assert_equal 4 . ...
let test_setup_upload ( ) = let upload_state = GapiMediaResource . setup_file_upload " test_data / test . pdf " in assert_equal { GapiMediaResource . state = GapiMediaResource . Request ; resource = { GapiMediaResource . source = GapiMediaResource . File " test_data / test . pdf " ; name = " test . pdf " ; content_type...
let test_generate_upload_request_post_headers ( ) = let upload_state = GapiMediaResource . setup_file_upload " test_data / test . pdf " in let headers = GapiMediaResource . generate_upload_headers GapiCore . HttpMethod . POST upload_state in assert_equal [ GapiCore . Header . UploadContentType " application / pdf " ; G...
let test_generate_upload_request_put_headers ( ) = let upload_state = GapiMediaResource . setup_file_upload " test_data / test . pdf " in let headers = GapiMediaResource . generate_upload_headers GapiCore . HttpMethod . PUT upload_state in assert_equal [ GapiCore . Header . UploadContentType " application / pdf " ; Gap...
let test_generate_upload_chunk_headers ( ) = let upload_state = GapiMediaResource . setup_file_upload ~ chunk_size : 1000 " test_data / test . pdf " in let upload_state = upload_state |> GapiMediaResource . state ^= GapiMediaResource . Uploading in let headers_start = GapiMediaResource . generate_upload_headers GapiCor...
let test_generate_resume_put_headers ( ) = let upload_state = GapiMediaResource . setup_file_upload " test_data / test . pdf " in let upload_state = upload_state |> GapiMediaResource . state ^= GapiMediaResource . Error in let headers = GapiMediaResource . generate_upload_headers GapiCore . HttpMethod . PUT upload_stat...
let test_update_upload_state ( ) = let upload_state = GapiMediaResource . setup_file_upload " test_data / test . pdf " in let upload_state ' = GapiMediaResource . update_upload_state " bytes 0 - 999 " upload_state in assert_equal 1000L upload_state ' . GapiMediaResource . current_offset
let test_generate_range_spec ( ) = assert_equal " bytes =- 500 " ( GapiMediaResource . generate_range_spec [ ( None , Some 500L ) 500L ] ) ; assert_equal " bytes = 9500 " - ( GapiMediaResource . generate_range_spec [ ( Some 9500L , None ) None ] ) ; assert_equal " bytes = 0 - 0 , - 1 " ( GapiMediaResource . generate_ra...
let test_generate_download_headers ( ) = let range_spec = GapiMediaResource . generate_range_spec [ ( Some 5L , Some 12L ) 12L ] in let download = { GapiMediaResource . destination = GapiMediaResource . TargetFile " / tmp / test . pdf " ; range_spec ; } in let headers = GapiMediaResource . generate_download_headers dow...
let test_create_out_channel_bigarray _ = let buffer = Bigarray . Array1 . create Bigarray . char Bigarray . c_layout 3 in let media_destination = GapiMediaResource . ArrayBuffer buffer in let download = { GapiMediaResource . destination = media_destination ; range_spec = " " } in let out_channel = GapiMediaResource . c...
let suite = " Media resource test " >::: [ " test_setup_upload " >:: test_setup_upload ; " test_generate_upload_request_post_headers " >:: test_generate_upload_request_post_headers ; " test_generate_upload_request_put_headers " >:: test_generate_upload_request_put_headers ; " test_generate_upload_chunk_headers " >:: te...
let encode_signed_suite = let open Capnp . Runtime . Util in let t0 _ctx = assert_equal ( encode_signed 17 0 ) 0 0 in let t1 _ctx = assert_equal ( encode_signed 17 0xffff ) 0xffff 0xffff in let t2 _ctx = assert_equal ( encode_signed 17 ( - 0x10000 ) 0x10000 ) 0x10000 0x10000 in let t3 _ctx = assert_equal ( encode_signe...
let decode_signed_suite = let open Capnp . Runtime . Util in let t0 _ctx = assert_equal ( decode_signed 17 0 ) 0 0 in let t1 _ctx = assert_equal ( decode_signed 17 0xffff ) 0xffff 0xffff in let t2 _ctx = assert_equal ( decode_signed 17 0x10000 ) 0x10000 ( - 0x10000 ) 0x10000 in let t3 _ctx = assert_equal ( decode_signe...
let cycle_suite = let open TestCycles in let t0 _ctx = let root = Builder . Foo . init_root ( ) in let bar = Builder . Foo . bar_init root in let foo2 = Builder . Bar . foo_init bar in Builder . Foo . x_set foo2 42l ; let root = Builder . Foo . to_reader root in let bar = Reader . Foo . bar_get root in let foo = Reader...
let test_tmpfile ( ) = let open Lwt_io in let validate_perm file = ( Rashell_Posix . ( test ( Not ( Or [ Has_at_least_permission ( 0o010 ) ; Has_at_least_permission ( 0o020 ) ; Has_at_least_permission ( 0o040 ) ; Has_at_least_permission ( 0o001 ) ; Has_at_least_permission ( 0o002 ) ; Has_at_least_permission ( 0o004 ) ;...
let test_tmpdir ( ) = let spec base = [ ( true , 0o700 , [ base ; " a " ] ) ; ( true , 0o750 , [ base ; " a " ; " b " ] ) ; ( false , 0o600 , [ base ; " a " ; " b " ; " x " ] ) ; ( false , 0o640 , [ base ; " a " ; " y " ] ) ; ( true , 0o700 , [ base ; " c " ] ) ; ( false , 0o200 , [ base ; " c " ; " z " ] ) ; ] in let ...
let ( ) = register_suite " mktemp " " Test suite for temporary files and directories " [ assert_true " tmpfile " test_tmpfile ( ) ; assert_true " tmpdir " test_tmpdir ( ) ; ]
let make_location path offset = { Location . device = Location . Path path ; offset = Int64 . of_int offset ; }
let make_linear start size path offset = { Target . start = Int64 . of_int start ; size = Int64 . of_int size ; kind = Target . Linear ( make_location path offset ) ; }
let make_striped start size stripe_size stripes = { Target . start = Int64 . of_int start ; size = Int64 . of_int size ; kind = Target . Striped { Striped . size = Int64 . of_int stripe_size ; Striped . stripes = Array . of_list stripes ; } ; }
let test_overlap ( ) = let with_overlap ( ? overlaps = 1 ) targets = Mock . clear ( ) ; assert_raises ( Failure ( Printf . sprintf " % d overlap ( s ) detected " overlaps ) ) ( fun ( ) -> Mock . create " device " targets ) in let without_overlap targets = Mock . clear ( ) ; Mock . create " name " targets in without_ove...
let test_reload ( ) = Mock . clear ( ) ; Mock . create " dev " [ ] ; begin match Mock . stat " dev " with | None -> failwith " Mock . stat yield None " | Some info -> assert_equal [ ] info . Mock . targets end ; let new_target = make_linear 0 1024 " dev1 " 0 in Mock . suspend " dev " ; Mock . reload " dev " [ new_targe...
let test_create_remove ( ) = Mock . clear ( ) ; Mock . create " dev " [ ] ; assert_raises ( Failure " dev already exists " ) ( fun ( ) -> Mock . create " dev " [ ] ) ; assert_equal [ " dev " ] ( Mock . ls ( ) ) ; Mock . remove " dev " ; assert_equal [ ] ( Mock . ls ( ) ) ; assert_raises ( Failure " dev does not exist "...
let test_real_mock ( ) = let select which : ( module Devmapper . S . DEVMAPPER ) = if which then ( module Devmapper . Linux ) else ( module Devmapper . Mock ) in let dm = select false in let module DM = ( val dm : Devmapper . S . DEVMAPPER ) in ignore ( DM . ls ( ) )
let test_separate_paths ( ) = Mock . set_path " dm - mock - 1 " ; Mock . clear ( ) ; Mock . create " dev1 " [ ] ; Mock . set_path " dm - mock - 2 " ; Mock . clear ( ) ; Mock . create " dev2 " [ ] ; Mock . set_path " dm - mock - 1 " ; assert_equal [ " dev1 " ] ( Mock . ls ( ) ) ; Mock . clear ( ) ; Mock . set_path " dm ...
let suite = " devmapper_mock " >::: [ " test_overlap " >:: test_overlap ; " test_reload " >:: test_reload ; " test_create_remove " >:: test_create_remove ; " test_real_mock " >:: test_real_mock ; " test_separate_paths " >:: test_separate_paths ; ]
let token_to_string = let open OASISAst_parser in function | EOF -> " EOF " | QSTRING s -> Printf . sprintf " % S " s | PLUS_COLON s -> Printf . sprintf " +: % S " s | DOLLAR_COLON -> " " $: | COLON s -> Printf . sprintf " : % S " s | IF -> " if " | LBRACE -> " { " | RBRACE -> " } " | ELSE -> " else " | SECTION knd -> ...
let string_of_top_stmt = let open OASISAst_types in let ppf fmt = Format . fprintf fmt in let rec ppf_top_stmt fmt = function | TSSection ( sct_knd , nm , stmt ) -> ppf fmt " TSSection ( [ @< hv >% s , @ % S , @ % a ] ) " @ ( OASISSection . string_of_section_kind sct_knd ) nm ppf_stmt stmt | TSStmt stmt -> ppf fmt " TS...
let pp_diff_top_stmt = let open OASISAst_types in let cond_prepend b v l = if b then v :: l else l in let rec diff_top_stmt = function | tstmt1 , tstmt2 when tstmt1 = tstmt2 -> [ ] | TSSection ( sct_knd1 , nm1 , stmt1 ) , TSSection ( sct_knd2 , nm2 , stmt2 ) -> if sct_knd1 <> sct_knd2 then [ Printf . sprintf " section ...
let tests = " OASISAst " >::: [ " OASISAst_lexer " >:: ( fun test_ctxt -> let open OASISAst_parser in let printer lst = String . concat " ; " ( List . map token_to_string lst ) in let rec all lst lexer lexbuf = match lexer lexbuf with | OASISAst_parser . EOF as tok -> List . rev ( tok :: lst ) | tok -> all ( tok :: lst...
let tests = " OASISFileSystem " >::: [ " defer_close " >:: ( fun _ -> let tester msg = let clsr = object val count = ref 0 method close = incr count method get_count = ! count end in clsr , fun ( ) -> assert_equal ~ msg ( : msg ^ " : number of time # close has been called . " ) ~ printer : string_of_int 1 clsr # get_co...
let tests = " OASISLibrary " >:: ( fun test_ctxt -> let in_dir lst = in_testdata_dir test_ctxt ( [ " TestOASISLibrary " ; " source_patterns " ] @ lst ) in let ctxt = oasis_ctxt test_ctxt in let sfs = new OASISFileSystem . host_fs ( in_dir [ ] ) in let pkg = OASISParse . from_file ~ ctxt ( in_dir [ " _oasis " ] ) in let...