text stringlengths 0 601k |
|---|
let suite = " assert " >::: [ " test_assert_true_ok " >:: test_assert_true_ok ; " test_assert_true_fail " >:: test_assert_true_fail ; " test_assert_equal_ok " >:: test_assert_equal_ok ; " test_assert_equal_fail " >:: test_assert_equal_fail ; " test_assert_equal_label " >:: test_assert_equal_label ; " test_assert_equal_... |
let test_string_id ~ f name ~ pass ~ fail = let test symbol ~ expected = let test_name = Stdlib . Format . sprintf " % s % S " name symbol in ( symbol , ` Quick , fun ( ) -> let got = f symbol in Alcotest . ( check bool ) test_name got expected ) in let test_true = List . map ~ f ( : test ~ expected : true ) in let tes... |
let test_is_prefix = test_string_id " is_prefix " ~ f : Ast . String_id . is_prefix ~ pass [ " " ; :! " " ; ? " " ] ~ ~ fail : [ " . " * ; " " + ; " " != ; " land " ; " lor " ; " " || ; " " @ ; " " :: ; " " := ; " let " + ; " and " + ; " . ( ) " ; " . ( ) " * ; " . ( ; . . ) " * ; " . [ ] " ; " . [ ] " * ; " . [ ; . . ... |
let test_is_infix = test_string_id " is_infix " ~ f : Ast . String_id . is_infix ~ pass : [ " . " ; * " " ; + " " ; != " land " ; " lor " ; " " ; || " " ; @ " " ; :: " " ; := " let " ; + " and " ] + ~ fail : [ " let " ; " let + abc " ; " and " ; " . ( ) " ; " . ( ) " * ; " . ( ; . . ) " * ; " . [ ] " ; " . [ ] " * ; " ... |
let test_is_symbol = test_string_id " is_symbol " ~ f : Ast . String_id . is_symbol ~ pass : [ " . " * ; " " + ; " " != ; " land " ; " lor " ; " " || ; " " @ ; " " :: ; " " := ; " let " + ; " and " + ; " . ( ) " ; " . ( ) " * ; " . ( ; . . ) " * ; " . [ ] " ; " . [ ] " * ; " . [ ; . . ] " * ; " . { } " ; " . { } " * ; ... |
let test_is_hash_getter = test_string_id " is_hash_getter " ~ f : Ast . String_id . is_hash_getter ~ pass [ " " ; :# " . " ; # " " ; ## " . " ; #++ " " ] #---# ~ fail : [ " let " ; " let + abc " ; " and " ; " . " * ; " " + ; " " != ; " land " ; " lor " ; " " || ; " " @ ; " " :: ; " " := ; " let " + ; " and " + ; " . ( ... |
let test_is_monadic_binding = test_string_id " is_monadic_binding " ~ f : Ast . String_id . is_monadic_binding ~ pass [ " : let " ; + " and " ] + ~ fail : [ " . " * ; " " + ; " " != ; " let " ; " let + abc " ; " and " ; " and " # ; " land " ; " lor " ; " " || ; " " @ ; " " :: ; " " := ; " . ( ) " ; " . ( ) " * ; " . ( ... |
let tests = List . concat [ test_is_prefix ; test_is_infix ; test_is_symbol ; test_is_hash_getter ; test_is_monadic_binding ] |
let from_file file = file |> BatFile . lines_of |> BatEnum . fold ( fun x y -> x ^ " \ n " ^ y ) y " " |> progs_eoi_p |
let _ = " test . ml " |> from_file |> code_of_progs |
let code_from_string str = str |> progs_eoi_p |> code_of_progs |
let _ = begin " def xx ( xx ) xx sin ( sin1 ) . * sin ( sin1 ) . + cos ( cos1 ) . * cos ( cos1 ) . ; " |> code_from_string |> ( fun ( [ Some f ] ) -> ExecutionEngine . run_function f [ | ] | the_execution_engine ) |> ( fun r -> prerr_endlinef " result --> % f " ( GenericValue . as_float double_type r ) r ) r |
let url = Uri . make ~ scheme " : http " ~ host " : echo . websocket . org " ~ path " : echo " ( ) |
let frame = testable Frame . pp Frame . equal |
let connect_f mv w = let msg = Frame . String . textf " msg " in write_frame_if_open w msg >>= fun ( ) -> Mvar . take mv >>= fun { header ; payload } -> write_frame_if_open w ( Frame . Bigstring . close ( ) ) >>= fun ( ) -> Mvar . take mv >>| fun _cl -> let msg ' = { Frame . header ; payload = Option . value ~ default ... |
let handle_incoming_frame mv x = Mvar . put mv x |
let connect ( ) = let mv = Mvar . create ( ) in Async_uri . connect url >>= fun { r ; w ; _ } -> Fastws_async . Raw . ( to_or_error ( connect url r w ) ) >>=? fun ( _exts , r , w ) -> Deferred . all_unit [ connect_f mv w ; Pipe . iter r ~ f ( : handle_incoming_frame mv ) ] >>= fun ( ) -> Deferred . Or_error . ok_unit |
let of_frame { Frame . payload ; _ } = Bigstring . to_string payload |
let to_frame msg = Frame . String . textf " % s " msg |
let connect_ez ( ) = Async_uri . with_connection url ( fun { r ; w ; _ } -> Fastws_async . Raw . to_or_error ( Fastws_async . connect url r w of_frame to_frame ) >>=? fun { r ; w ; _ } -> Pipe . write w msg >>= fun ( ) -> Pipe . read r >>= fun res -> Pipe . close w ; Pipe . close_read r ; Deferred . all_unit [ Pipe . c... |
let with_connection_ez ( ) = Async_uri . with_connection url ( fun { r ; w ; _ } -> Fastws_async . with_connection url r w of_frame to_frame ( fun r w -> Pipe . write w msg >>= fun ( ) -> Pipe . read r >>| function | ` Eof -> failwith " did not receive echo " | ` Ok msg ' -> check string " " msg msg ' ) |> Fastws_async... |
let runtest a b c = Alcotest_async . test_case a b ( fun ( ) -> Deferred . Or_error . ok_exn ( c ( ) ) ) |
let async = [ runtest " connect " ` Quick connect ; runtest " connect_ez " ` Quick connect_ez ; runtest " with_connection_ez " ` Quick with_connection_ez ] |
let main ( ) = Alcotest . run " fastws - async " [ ( " async " , async ) ] |
let ( ) = main ( ) ; never_returns ( Scheduler . go ( ) ) |
let chunk_body = [ " one " ; " " ; " " ; " bar " ; " " ] |
let large_string = String . make ( Int . pow 2 16 ) ' A ' |
let response_bodies = [ " Testing " ; " Foo bar " ] |
let ok s = Server . respond ` OK ~ body ( : Body . of_string s ) |
let chunk size = String . init ~ f ( : Fn . const ' X ' ) size |
let server = [ const @@ Server . respond ` OK ~ body ( : Body . of_string_list chunk_body ) ; const @@ Server . respond_string large_string ; ( fun _ body -> body |> Body . to_string >>| String . length >>= fun len -> Server . respond_string ( Int . to_string len ) >>| response ) ; ] @ ( response_bodies |> List . map ~... |
let ts = test_server_s server ( fun uri -> let headers = Header . init_with " connection " " close " in let empty_chunk ( ) = Client . get ~ headers uri >>= fun ( _ , body ) -> body |> Body . to_string >>| fun body -> assert_equal body ( String . concat ~ sep " " : chunk_body ) in let large_response ( ) = Client . get ... |
let ( ) = ts |> run_async_tests >>= ( fun _ -> Async_unix . Shutdown . exit 0 ) |> don ' t_wait_for ; Core . never_returns ( Async_unix . Scheduler . go ( ) ) |
let current_section = ref " " |
let section = let first_section = ref true in fun name -> current_section := name ; if ! first_section then first_section := false |
let errors = ref [ ] |
let fail ( ) = errors := ! current_section :: ! errors ; raise Failed |
let check b = if not b then fail ( ) |
let check_valid = function | None -> ( ) | Some _ -> fail ( ) |
let check_invalid = function | None -> fail ( ) | Some _ -> ( ) |
let expect_error f x = try ignore ( f x ) ; eprintf " Did not get expected error \ n " ; %! fail ( ) with Atdgen_runtime . Ob_run . Error _ | Atdgen_runtime . Oj_run . Error _ -> ( ) |
let test_missing_record = { Test . b0 = 123 ; b1 = true } |
let test_extended_record = { Test . b0x = 55 ; b1x = false ; b2x = " abc " ; b3x = Some " def " ; b4x = Some " ghi " ; b5x = 1 . 1 ; } |
let test_missing_tuple = ( 123 , 4 . 56 ) |
type internals1 = { int : int } |
type internals2 = { float : float } | 21907 -> field_b5x := ( ( Atdgen_runtime . Ob_run . read_float64 ) ib ) ; | _ -> Bi_io . skip ib done ; if ! bits0 <> 0xf then Atdgen_runtime . Ob_run . missing_fields [ | ! bits0 ] | [ | " b0 " ; " b1 " ; " b2 " ; " b4 " ] ; | ( { b0x = ! field_b0x ; b1x = ! field_b1x ; b2x = ! fi... |
let test_ocaml_internals ( ) = section " ocaml internals " ; let opaque_identity = let opaque_identity x = x in opaque_identity ( ) ; opaque_identity in let int = ref ( Obj . magic ( opaque_identity 0 . 0 ) ) in Gc . compact ( ) ; int := 123 ; Gc . compact ( ) ; check ( { int = ! int } . int = 123 ) ; let float = ref (... |
let test_biniou_missing_field ( ) = section " biniou missing record fields " ; expect_error Test . extended_of_string ( Test . string_of_base test_missing_record ) |
let test_biniou_missing_cell ( ) = section " biniou missing tuple fields " ; expect_error Test . extended_tuple_of_string ( Test . string_of_base_tuple test_missing_tuple ) |
let test_biniou_read_write_unit ( ) = section " biniou read / write unit " ; Test_unit_biniou_b . t_of_string ( Test_unit_biniou_b . string_of_t ( ) ) |
let test_json_missing_field ( ) = section " json missing record fields " ; expect_error Testj . extended_of_string ( Testj . string_of_base test_missing_record ) |
let test_json_missing_cell ( ) = section " json missing tuple fields " ; expect_error Testj . extended_tuple_of_string ( Testj . string_of_base_tuple test_missing_tuple ) |
let test_json_extra_field_warning ( ) = section " json extra field warning " ; ignore ( Testj . base_of_string ( Testj . string_of_extended test_extended_record ) ) |
let test_json_assoc_list ( ) = section " json association list " ; let f l = let s = Testj . string_of_int_assoc_list l in check ( Testj . int_assoc_list_of_string s = l ) in f [ ] ; f [ ( " a " , 0 ) ] ; f [ ( " a " , 0 ) ; ( " b " , 1 ) ] |
let test_json_assoc_array ( ) = section " json association array " ; let f a = let s = Testj . string_of_int_assoc_array a in check ( Testj . int_assoc_array_of_string s = a ) in f [ | ] ; | f [ | ( " a " , 0 ) ] ; | f [ | ( " a " , 0 ) ; ( " b " , 1 ) ] | |
let test_json_int_ocaml_float_gen of_json to_json kind ( ) = section ( " json ints derived from ocaml floats : " ^ kind ) ; let l1 = [ 0 . ; 0 . 1 ; - 0 . 1 ; 0 . 6 ; - 0 . 6 ] in check ( of_json ( to_json l1 ) = [ 0 . ; 0 . ; 0 . ; 1 . ; - 1 . ] ) ; let l2 = [ 12345678901234567890 . ; - 12345678901234567890 . ] in let... |
let test_json_int_ocaml_float ( ) = test_json_int_ocaml_float_gen Test3j_j . unixtime_list_of_string Test3j_j . string_of_unixtime_list " int < ocaml repr " =\ float " " \> ( ) ; test_json_int_ocaml_float_gen Testj . unixtime_list_of_string Testj . string_of_unixtime_list " float < json repr " =\ int " " \> ( ) |
let make_mixed_record_array n = Array . init n ( fun i -> { Test . field0 = Some i ; field1 = Some 0 . 555 ; field2 = Some " abcdefghijklmnopqrstuvwxyz " ; field3 = 12345678L ; field4 = [ | 1 . 23 ; 3 . 45 ; 4 . 56 ] ; | field5 = None ; field6 = None ; field7 = ` Case4 [ ` Case1 ; ` Case2 999 ; ` Case3 " abcdefghij " ;... |
let make_mixed ~ top_len ~ tab_len ~ ar_len = List . init top_len ( fun _ -> ( make_mixed_record_array tab_len , make_mixed_record_array ar_len ) ) |
let test_correctness_data = { Test . x0 = Some 123 ; x1 = Some 1 . 23 ; x2 = make_mixed ~ top_len : 2 ~ tab_len : 2 ~ ar_len : 2 ; x3 = [ { Test . field0 = Some 1234 ; field1 = Some 1e6 ; field2 = Some " Hello " ; field3 = 12345678L ; field4 = [ | 1 . 23 ; 3 . 45 ; 5 . 67 ] ; | field5 = None ; field6 = None ; field7 = ... |
let save file s = let oc = open_out_bin file in output_string oc s ; close_out oc |
let test_biniou_correctness ( ) = section " biniou correctness " ; let x = test_correctness_data in let s = Test . string_of_test x in save " test . bin " s ; let x ' = Test . test_of_string s in let s ' = Test . string_of_test x ' in let x ' ' = Test . test_of_string s ' in save " test - 2 . bin " s ' ; if x <> x ' th... |
let test_json_correctness ( ) = section " json correctness " ; let x = test_correctness_data in let s = Testj . string_of_test x in save " test . json " s ; let x ' = Testj . test_of_string s in let s ' = Testj . string_of_test x ' in let x ' ' = Testj . test_of_string s ' in save " test - 2 . json " s ' ; let std_x ' ... |
let test_json_space ( ) = section " json space " ; let s = Testj . string_of_test test_correctness_data in let pp = Yojson . Safe . prettify s in ignore ( Testj . test_of_string pp ) |
let test_validators0 ( ) = section " validators0 " ; check_valid ( Testv . validate_test [ ] test_correctness_data ) |
let test_validators1 ( ) = section " validators1 " ; let valid = ( 0 , 1 . ) in let invalid = ( 1 , 0 . ) in check_valid ( Testv . validate_base_tuple [ ] valid ) ; check_invalid ( Testv . validate_base_tuple [ ] invalid ) ; let x1 = { Test . b0x = 1 ; b1x = true ; b2x = " abc " ; b3x = Some " def " ; b4x = Some " ghi ... |
let test_validators2 ( ) = section " validators2 " ; let v1 = ` A in check_invalid ( Testv . validate_p [ ] v1 ) ; let v2 = ` B { Test . a = 0 ; b = true ; c = ` C } in check_valid ( Testv . validate_p [ ] v2 ) |
let test_validators3 ( ) = section " validators3 " ; let o = Some 0 in check_invalid ( Testv . validate_option_validation [ ] o ) |
let test_validators4 ( ) = section " validators4 " ; let x = { Test . val2_x = { Test . val1_x = 0 } ; val2_y = Some { Test . val1_x = 1 } } in check_invalid ( Testv . validate_val2 [ ] x ) |
let test_json_files ( ) = section " json files " ; let x = Some 123 in let s = Atdgen_runtime . Util . Json . to_string Testj . write_intopt x in let x ' = Atdgen_runtime . Util . Json . from_string Testj . read_intopt s in check ( x = x ' ) ; Atdgen_runtime . Util . Json . to_file Testj . write_intopt " test - json - ... |
let test_json_streams ( ) = section " json streams " ; let l = [ Some 1 ; None ; Some 2 ; Some 3 ] in let s = Atdgen_runtime . Util . Json . list_to_string Testj . write_intopt l in let l ' = Atdgen_runtime . Util . Json . list_from_string Testj . read_intopt s in check ( l = l ' ) ; Atdgen_runtime . Util . Json . list... |
let test_raw_json ( ) = section " raw json " ; let x = { Test3j_t . foo = 12345 ; bar = ` List [ ` Int 12 ; ` String " abc " ] ; baz = ` Bool false } in let s = Test3j_j . string_of_t x in let x ' = Test3j_j . t_of_string s in check ( x = x ' ) |
let test_wrapping_ints ( ) = section " ocaml wrapping - ints " ; let x = Test_lib . Natural . wrap 7 in let json = Testj . string_of_natural x in let x ' = Testj . natural_of_string json in check ( x = x ' ) ; let biniou = Test . string_of_natural x in let x ' ' = Test . natural_of_string biniou in check ( x = x ' ' ) ... |
let test_double_wrapping ( ) = section " ocaml wrapping - double wrapping " ; let x = Test_lib . Even_natural . wrap ( Test_lib . Natural . wrap 10 ) in let json = Testj . string_of_even_natural x in let x ' = Testj . even_natural_of_string json in check ( x = x ' ) |
let test_wrapping_with_validation ( ) = section " ocaml wrapping - with validation " ; let x = ` Id " " in try ignore ( Testv . validate_id [ ] x ) ; check false with Failure " empty " -> ( ) |
let test_ignored_wrap ( ) = section " ocaml wrapping - wrap constructor without wrapper " ; let x = { Test . some_field = 0 } in try ignore ( Testv . validate_no_real_wrap [ ] x ) ; check false with Failure " passed " -> ( ) |
let test_biniou_float32 ( ) = section " check length of floats serialized as float32 " ; let x = { Test . f32 = 1 . 23456789 ; Test . f64 = 1 . 98765432 } in let s = Test . string_of_floats x in let x ' = Test . floats_of_string s in check Test . ( abs_float ( x . f32 . - x ' . f32 ) < 1e - 6 ) ; check ( String . lengt... |
let test_json_float_decimals ( ) = section " print JSON floats with maximum number of decimal places " ; let x = { Testj . sqrt2_5 = sqrt 2 . ; small_2 = 0 . 000123456789 ; large_2 = 1234567890123 . ; } in let s = Testj . string_of_precision x in check ( s = " { " \ sqrt2_5 " \: 1 . 4142 , " \ small_2 " \: 0 . 00012 , ... |
let test_patch ( ) = section " read json record with null fields meaning ( Some None ) " ; let json = { | { " patch1 " : 1 , " patch2 " : null } } | in let open Test3j_t in let x = Test3j_j . patch_of_string json in check ( x . patch1 = Some ( Some 1 ) ) ; check ( x . patch2 = Some None ) ; check ( x . patch3 = None ) |
let test_adapted ( ) = section " read and write a variant represented as a json object \ with a ` type ` field " ; let json_a = { | { " type " : " a " , " thing " : " abc " , " other_thing " : true , " ignored " : 555 } } | in let json_b = { | { " thing " : 123 , " type " : " b " , " other_thing " : true } } | in let e... |
let test_one_field ( ) = section " test variants represented with single - field json objects " ; let a_json = { | { " a " : true } } | in let b_json = { | { " b " : 17 } } | in let a = Test3j_j . sf_adapted_of_string a_json in let b = Test3j_j . sf_adapted_of_string b_json in check ( a = ` A true ) ; check ( b = ` B 1... |
let test_tag_field_emulation ( ) = section " emulate the retired tag_field feature " ; let json_in = { | { " the_type " : " a " , " the_value " : 123 , " etc " : " blah " } } | in let x = Test3j_j . tf_record_of_string json_in in check ( x = { the_value = ` A 123 ; etc = " blah " } ) ; let json_out = Test3j_j . string_... |
let test_tag_field_emulation_with_catchall ( ) = section " emulate the retired tag_field feature , with a catch - all \ for unknown tags " ; let json_in = { | { " the_type " : " x " , " the_value2 " : 3 , " etc2 " : " blah " } } | in let x = Test3j_j . tf_record2_of_string json_in in check ( x = { the_value2 = ` Unknow... |
let test_json_open_enum ( ) = section " test < json open_enum " ; > let json_in = { | [ " Alpha " , " Gamma " ] } | in let x = Test3j_j . sample_open_enums_of_string json_in in check ( x = [ ` Alpha ; ` Other " Gamma " ] ) ; let json_out = Test3j_j . string_of_sample_open_enums x in let x2 = Test3j_j . sample_open_enum... |
let test_ambiguous_record ( ) = section " test ambiguous record with json adapters " ; let json_in = { { | ambiguous " : x " , not_ambiguous1 : 0 } } | in let json_in ' = { { | ambiguous " : x ' " , not_ambiguous2 : 1 } } | in let x , x ' = Test_ambiguous_record_j . ambiguous_of_string json_in , Test_ambiguous_record_j... |
let test_polymorphic_wrap ( ) = section " test wrapping of polymorphic types " ; let json_in = { [ " | 1 " , [ " 2 " ] ] } | in let x = Test_polymorphic_wrap_j . t_of_string Yojson . Safe . read_string json_in in let json_out = Test_polymorphic_wrap_j . string_of_t Yojson . Safe . write_string x in let x2 = Test_polymo... |
let test_encoding_int64 ( ) = section " json encoding int64 as string " ; let encoded = Test_int64_enc_j . string_of_int64 Int64 . max_int in check ( String . equal encoded { " | 9223372036854775807 " } ) | |
let test_encoding_decoding_int64 ( ) = section " json encoding & decoding int64 " ; let encoded = Test_int64_enc_j . string_of_int64 Int64 . max_int in let decoded = Test_int64_enc_j . int64_of_string encoded in check ( decoded = Int64 . max_int ) |
let all_tests = [ test_ocaml_internals ; test_biniou_missing_field ; test_biniou_missing_cell ; test_json_missing_field ; test_json_missing_cell ; test_json_extra_field_warning ; test_json_assoc_list ; test_json_assoc_array ; test_json_int_ocaml_float ; test_biniou_read_write_unit ; test_biniou_correctness ; test_json_... |
let quality_test ( ) = List . iter ( fun f -> try f ( ) with Failed -> ( ) ) all_tests ; match List . rev ! errors with | [ ] -> ( ) | l -> eprintf " \ nThe following tests failed :\ n % s \ n " ( String . concat " \ n " l ) ; eprintf " *** FAILURE ***\ n " ; exit 1 |
let ( ) = quality_test ( ) |
let toggle ? at onclick ~ off : off_label ~ on : on_label = let on = ref false in let but = El . button ? at [ El . txt ' off_label ] in let onclick _e = onclick ! on ; on := not ! on ; El . set_children but [ El . txt ' ( if ! on then on_label else off_label ) ] ; in Ev . listen Ev . click onclick ( El . as_target but... |
let set_canvas_size cnv ~ r = let el = Canvas . to_el cnv in let w = El . inner_w el in let h = Jstr . ( of_int ( truncate ( w . * r ) ) + v " px " ) in El . set_inline_style El . Style . height h el ; Canvas . set_size_to_layout_size cnv |
let clear_canvas c ~ w ~ h = C2d . set_fill_style c ( C2d . color ( Jstr . v " # EEE " ) ) ; C2d . fill_rect c ~ x : 0 . ~ y : 0 . ~ w ~ h |
let wave_data c ~ x ~ y ~ w ~ h data = C2d . set_stroke_style c ( C2d . color ( Jstr . v " # 000 " ) ) ; C2d . set_line_width c ( 1 . . * Window . device_pixel_ratio G . window ) ; let p = C2d . Path . create ( ) in let slice_width = w . / float ( Tarray . length data ) in let x = ref x in for i = 0 to Tarray . length ... |
let freq_data c ~ x ~ y ~ w ~ h data = C2d . set_fill_style c ( C2d . color ( Jstr . v " # 000 " ) ) ; let bw = ( w . / float ( Tarray . length data ) ) . * 5 . in let x = ref x in for i = 0 to Tarray . length data - 1 do let bh = float ( Tarray . get data i ) . / 2 . in C2d . fill_rect c ~ x :! x ~ y ( : y . + h . - 0... |
let draw_sound_data cnv wave freq = let c = C2d . create cnv in let w = float @@ Canvas . w cnv in let h = float @@ Canvas . h cnv in let hh = 0 . 5 . * h in clear_canvas c ~ w ~ h ; wave_data c ~ x : 0 . ~ y : 0 . ~ w ~ h : hh wave ; freq_data c ~ x : 0 . ~ y : hh ~ w ~ h : hh freq ; ( ) |
let draw_data cnv get_data = let rec draw _ = let wave , freq = get_data ( ) in draw_sound_data cnv wave freq ; ignore ( G . request_animation_frame draw ) in draw 0 . |
let analyser c = let a = Audio . Node . Analyser . create c in let len = Audio . Node . Analyser . frequency_bin_count a in let w = Tarray . create Tarray . Uint8 len in let f = Tarray . create Tarray . Uint8 len in let get_data ( ) = Audio . Node . Analyser . get_byte_time_domain_data a w ; Audio . Node . Analyser . g... |
let ctx_and_dst = ref None |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.