@@ -39,6 +39,7 @@ groups() ->
39
39
40
40
cases () ->
41
41
[
42
+ start_link_inits_and_accepts_records ,
42
43
inserted_records_could_be_read_back ,
43
44
insert_many_with_one_record ,
44
45
insert_many_with_two_records ,
@@ -52,6 +53,7 @@ cases() ->
52
53
join_works_with_existing_data_with_conflicts_and_defined_conflict_handler_and_more_keys ,
53
54
join_works_with_existing_data_with_conflicts_and_defined_conflict_handler_and_keypos2 ,
54
55
bag_with_conflict_handler_not_allowed ,
56
+ bag_with_conflict_handler_not_allowed_for_start_link ,
55
57
insert_new_works ,
56
58
insert_new_works_with_table_name ,
57
59
insert_new_works_when_leader_is_back ,
@@ -274,6 +276,12 @@ end_per_testcase(_, _Config) ->
274
276
log_modules () ->
275
277
[cets , cets_call , cets_long , cets_join , cets_discovery ].
276
278
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
+
277
285
inserted_records_could_be_read_back (Config ) ->
278
286
Tab = make_name (Config ),
279
287
start_local (Tab ),
@@ -747,6 +755,10 @@ bag_with_conflict_handler_not_allowed(Config) ->
747
755
{error , [bag_with_conflict_handler ]} =
748
756
cets :start (make_name (Config ), #{handle_conflict => fun resolve_highest /2 , type => bag }).
749
757
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
+
750
762
join_with_the_same_pid (Config ) ->
751
763
Tab = make_name (Config ),
752
764
{ok , Pid } = start_local (Tab ),
@@ -2917,6 +2929,16 @@ still_works(Pid) ->
2917
2929
ok = cets :insert (Pid , {1 }),
2918
2930
{ok , [{1 }]} = cets :remote_dump (Pid ).
2919
2931
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 (Name , Opts ),
2939
+ schedule_cleanup (Pid ),
2940
+ {ok , Pid }.
2941
+
2920
2942
start_local (Name ) ->
2921
2943
start_local (Name , #{}).
2922
2944
0 commit comments