aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2018-11-07 15:34:07 +0100
committerJohn Högberg <[email protected]>2018-11-09 12:53:44 +0100
commit14cfdc2e8026dde8adeb43b6efb05122d7ff7c59 (patch)
tree2a8d3c2616f204154e04e708614c1fa660b01dc7 /lib/stdlib/test
parent506855722d1cb5cd7c81e608cce33526ff9d20e8 (diff)
downloadotp-14cfdc2e8026dde8adeb43b6efb05122d7ff7c59.tar.gz
otp-14cfdc2e8026dde8adeb43b6efb05122d7ff7c59.tar.bz2
otp-14cfdc2e8026dde8adeb43b6efb05122d7ff7c59.zip
Make '++'/2 trapping
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r--lib/stdlib/test/lists_SUITE.erl14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/stdlib/test/lists_SUITE.erl b/lib/stdlib/test/lists_SUITE.erl
index 17bb12e548..316b7a1ffa 100644
--- a/lib/stdlib/test/lists_SUITE.erl
+++ b/lib/stdlib/test/lists_SUITE.erl
@@ -158,6 +158,20 @@ append_2(Config) when is_list(Config) ->
"abcdef"=lists:append("abc", "def"),
[hej, du]=lists:append([hej], [du]),
[10, [elem]]=lists:append([10], [[elem]]),
+
+ %% Trapping, both crashing and otherwise.
+ [append_trapping_1(N) || N <- lists:seq(0, 20)],
+
+ ok.
+
+append_trapping_1(N) ->
+ List = lists:duplicate(N + (1 bsl N), gurka),
+ ImproperList = List ++ crash,
+
+ {'EXIT',_} = (catch (ImproperList ++ [])),
+
+ [3, 2, 1 | List] = lists:reverse(List ++ [1, 2, 3]),
+
ok.
%% Tests the lists:reverse() implementation. The function is