aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/test_lib.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-04-27 06:15:24 +0200
committerBjörn Gustavsson <[email protected]>2015-04-29 12:25:06 +0200
commitf4adfc60acb46a86f49627397913b6841b744ed2 (patch)
tree071c88a5481747948c6851b7b9fa1bb171a36fa6 /lib/compiler/test/test_lib.erl
parentfa237854a74a24ac7b940b1333828d4fffec7b5a (diff)
downloadotp-f4adfc60acb46a86f49627397913b6841b744ed2.tar.gz
otp-f4adfc60acb46a86f49627397913b6841b744ed2.tar.bz2
otp-f4adfc60acb46a86f49627397913b6841b744ed2.zip
test_lib: Simplify uniq/0
Simplify the uniq/0 function by using erlang:unique_integer/1.
Diffstat (limited to 'lib/compiler/test/test_lib.erl')
-rw-r--r--lib/compiler/test/test_lib.erl6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/compiler/test/test_lib.erl b/lib/compiler/test/test_lib.erl
index a5e2855f8c..4ffac95489 100644
--- a/lib/compiler/test/test_lib.erl
+++ b/lib/compiler/test/test_lib.erl
@@ -57,10 +57,8 @@ parallel() ->
end.
uniq() ->
- U0 = erlang:ref_to_list(make_ref()),
- U1 = re:replace(U0, "^#Ref", ""),
- U = re:replace(U1, "[^[A-Za-z0-9_]+", "_", [global]),
- re:replace(U, "_*$", "", [{return,list}]).
+ U = erlang:unique_integer([positive]),
+ "_" ++ integer_to_list(U).
%% Retrieve the "interesting" compiler options (options for optimization
%% and compatibility) for the given module.