@@ -39,6 +39,7 @@ groups() ->
3939
4040cases () ->
4141 [
42+ start_link_inits_and_accepts_records ,
4243 inserted_records_could_be_read_back ,
4344 insert_many_with_one_record ,
4445 insert_many_with_two_records ,
@@ -52,6 +53,7 @@ cases() ->
5253 join_works_with_existing_data_with_conflicts_and_defined_conflict_handler_and_more_keys ,
5354 join_works_with_existing_data_with_conflicts_and_defined_conflict_handler_and_keypos2 ,
5455 bag_with_conflict_handler_not_allowed ,
56+ bag_with_conflict_handler_not_allowed_for_start_link ,
5557 insert_new_works ,
5658 insert_new_works_with_table_name ,
5759 insert_new_works_when_leader_is_back ,
@@ -274,6 +276,12 @@ end_per_testcase(_, _Config) ->
274276log_modules () ->
275277 [cets , cets_call , cets_long , cets_join , cets_discovery ].
276278
279+ start_link_inits_and_accepts_records (Config ) ->
280+ Tab = make_name (Config ),
281+ start_link_local (Tab ),
282+ cets :insert (Tab , {alice , 32 }),
283+ [{alice , 32 }] = ets :lookup (Tab , alice ).
284+
277285inserted_records_could_be_read_back (Config ) ->
278286 Tab = make_name (Config ),
279287 start_local (Tab ),
@@ -747,6 +755,10 @@ bag_with_conflict_handler_not_allowed(Config) ->
747755 {error , [bag_with_conflict_handler ]} =
748756 cets :start (make_name (Config ), #{handle_conflict => fun resolve_highest /2 , type => bag }).
749757
758+ bag_with_conflict_handler_not_allowed_for_start_link (Config ) ->
759+ {error , [bag_with_conflict_handler ]} =
760+ cets :start_link (make_name (Config ), #{handle_conflict => fun resolve_highest /2 , type => bag }).
761+
750762join_with_the_same_pid (Config ) ->
751763 Tab = make_name (Config ),
752764 {ok , Pid } = start_local (Tab ),
@@ -2917,6 +2929,16 @@ still_works(Pid) ->
29172929 ok = cets :insert (Pid , {1 }),
29182930 {ok , [{1 }]} = cets :remote_dump (Pid ).
29192931
2932+ start_link_local (Name ) ->
2933+ start_link_local (Name , #{}).
2934+
2935+ start_link_local (Name , Opts ) ->
2936+ catch cets :stop (Name ),
2937+ wait_for_name_to_be_free (node (), Name ),
2938+ {ok , Pid } = cets :start_link (Name , Opts ),
2939+ schedule_cleanup (Pid ),
2940+ {ok , Pid }.
2941+
29202942start_local (Name ) ->
29212943 start_local (Name , #{}).
29222944
0 commit comments