Skip to content

Commit ba549c9

Browse files
BenHuddlestonPeter-Searby
authored andcommitted
MB-67857[BP]: Reformat fake_chronicle_kv.erl
The formatting does not comply with emacs formatting. Change-Id: Idf1674f4491644b56f09aa3488a5e9f803e2c794 Reviewed-on: https://review.couchbase.org/c/ns_server/+/231991 Reviewed-by: Ben Huddleston <[email protected]> Well-Formed: Build Bot <[email protected]> Well-Formed: Restriction Checker Tested-by: Peter Searby <[email protected]>
1 parent 092897b commit ba549c9

File tree

1 file changed

+40
-39
lines changed

1 file changed

+40
-39
lines changed

test/fake_helpers/fake_chronicle_kv.erl

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ update_snapshot(Key, Value) ->
7575
-spec update_snapshot(map()) -> true.
7676
update_snapshot(Map) when is_map(Map) ->
7777
NewKVs = maps:map(
78-
fun(_Key, Value) ->
79-
add_rev_to_value(Value)
80-
end, Map),
78+
fun(_Key, Value) ->
79+
add_rev_to_value(Value)
80+
end, Map),
8181
OldSnapshot = get_ets_snapshot(),
8282
NewSnapshot = maps:merge(OldSnapshot, NewKVs),
8383
store_ets_snapshot(NewSnapshot).
@@ -111,59 +111,60 @@ meck_setup_chronicle_kv() ->
111111
meck_setup_chronicle_kv_setters().
112112

113113
meck_setup_chronicle_kv_getters() ->
114-
meck:expect(chronicle_kv, get_snapshot,
115-
fun (_Fetchers, _Opts) ->
116-
%% Don't care about fetchers, return the entire config. We
117-
%% should be using lookup functions to get specific keys
118-
%% anyways so this should just work, and we don't care about
119-
%% perf here.
120-
get_ets_snapshot()
121-
end),
114+
meck:expect(
115+
chronicle_kv, get_snapshot,
116+
fun (_Fetchers, _Opts) ->
117+
%% Don't care about fetchers, return the entire config. We
118+
%% should be using lookup functions to get specific keys
119+
%% anyways so this should just work, and we don't care about
120+
%% perf here.
121+
get_ets_snapshot()
122+
end),
122123

123124

124125
meck:expect(chronicle_kv, ro_txn,
125-
fun(_Name, _Fun, _Opts) ->
126-
{ok, {get_ets_snapshot(), no_rev}}
127-
end),
126+
fun(_Name, _Fun, _Opts) ->
127+
{ok, {get_ets_snapshot(), no_rev}}
128+
end),
128129

129130

130131
meck:expect(chronicle_kv, txn_get_many,
131-
fun(Keys, Txn) ->
132-
get_keys_for_txn(Keys, Txn)
133-
end),
132+
fun(Keys, Txn) ->
133+
get_keys_for_txn(Keys, Txn)
134+
end),
134135

135136

136137
meck:expect(chronicle_kv, get,
137-
fun(_Name, Key) ->
138-
fetch_from_latest_snapshot(Key)
139-
end),
138+
fun(_Name, Key) ->
139+
fetch_from_latest_snapshot(Key)
140+
end),
140141
meck:expect(chronicle_kv, get,
141-
fun(_Name, Key, #{}) ->
142-
fetch_from_latest_snapshot(Key)
143-
end).
142+
fun(_Name, Key, #{}) ->
143+
fetch_from_latest_snapshot(Key)
144+
end).
144145

145146
meck_setup_chronicle_kv_setters() ->
146147
meck:expect(chronicle_kv, transaction,
147-
fun(Name, Keys, Fun) ->
148-
transaction(Name, Keys, Fun, #{})
149-
end),
148+
fun(Name, Keys, Fun) ->
149+
transaction(Name, Keys, Fun, #{})
150+
end),
150151

151152
meck:expect(chronicle_kv, transaction,
152-
fun(Name, Keys, Fun, Opts) ->
153-
transaction(Name, Keys, Fun, Opts)
154-
end),
153+
fun(Name, Keys, Fun, Opts) ->
154+
transaction(Name, Keys, Fun, Opts)
155+
end),
155156

156157
meck:expect(chronicle_kv, txn,
157-
fun(Name, Fun, Opts) ->
158-
transaction(Name, [], Fun, Opts)
159-
end),
158+
fun(Name, Fun, Opts) ->
159+
transaction(Name, [], Fun, Opts)
160+
end),
160161

161162

162163
meck:expect(chronicle_kv, set,
163-
fun(_Name, Key, Value) ->
164-
update_snapshot(Key, Value),
165-
{ok, 1}
166-
end).
164+
fun(_Name, Key, Value) ->
165+
update_snapshot(Key, Value),
166+
{ok, 1}
167+
end).
167168

168169
%% ----------------------------------
169170
%% Internal - getter/setter functions
@@ -205,9 +206,9 @@ get_keys_for_txn(_Keys, _Snapshot) ->
205206

206207
do_commits(Commits) ->
207208
NewMap = lists:foldl(
208-
fun({set, Key, Value}, Acc) ->
209-
Acc#{Key => Value}
210-
end, #{}, Commits),
209+
fun({set, Key, Value}, Acc) ->
210+
Acc#{Key => Value}
211+
end, #{}, Commits),
211212
update_snapshot(NewMap).
212213

213214
transaction(_Name, Keys, Fun, _Opts) ->

0 commit comments

Comments
 (0)