aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/small_SUITE_data/src
diff options
context:
space:
mode:
authorStavros Aronis <[email protected]>2011-03-21 18:39:54 +0200
committerHenrik Nord <[email protected]>2011-05-04 15:06:16 +0200
commit4db4b78d1e8c27774c4d803723f4aa6a5df2009c (patch)
treec32cedb5a21a90beca7ac866d9d9a3f343bda11d /lib/dialyzer/test/small_SUITE_data/src
parent120aa71bca7c6b9de3e0abec3942e6012f4a80fd (diff)
downloadotp-4db4b78d1e8c27774c4d803723f4aa6a5df2009c.tar.gz
otp-4db4b78d1e8c27774c4d803723f4aa6a5df2009c.tar.bz2
otp-4db4b78d1e8c27774c4d803723f4aa6a5df2009c.zip
Add small/ets_update_counter
Diffstat (limited to 'lib/dialyzer/test/small_SUITE_data/src')
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/ets_update_counter.erl25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/dialyzer/test/small_SUITE_data/src/ets_update_counter.erl b/lib/dialyzer/test/small_SUITE_data/src/ets_update_counter.erl
new file mode 100644
index 0000000000..057748cfb4
--- /dev/null
+++ b/lib/dialyzer/test/small_SUITE_data/src/ets_update_counter.erl
@@ -0,0 +1,25 @@
+-module(ets_update_counter).
+
+-export([ti/2, tl/2, tn/2, tt/2, tu/3, tmix/3]).
+
+ti(T, K) ->
+ ets:update_counter(T, K, 42).
+
+tl(T, K) ->
+ ets:update_counter(T, K, [{2,1}, {3,2}]).
+
+tn(T, K) ->
+ ets:update_counter(T, K, []).
+
+tt(T, K) ->
+ ets:update_counter(T, K, {4,2}).
+
+tu(T, K, Op) ->
+ ets:update_counter(T, K, Op).
+
+tmix(T, K, Choice) ->
+ Op = get_op(Choice),
+ ets:update_counter(T, K, Op).
+
+get_op(i) -> 42;
+get_op(t) -> {4,2}.