aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
diff options
context:
space:
mode:
authorHans Svensson <[email protected]>2014-01-22 22:10:14 +0100
committerHans Svensson <[email protected]>2014-01-24 19:30:01 +0100
commit254e58d2f4799e40be1188d95d59cdc7a616f5d9 (patch)
treeb020386d22e094edc170f9afff4daed840f2f2f8 /lib/stdlib/test
parent8c4f797785a8510e5662a27bfcb7359d32491de7 (diff)
downloadotp-254e58d2f4799e40be1188d95d59cdc7a616f5d9.tar.gz
otp-254e58d2f4799e40be1188d95d59cdc7a616f5d9.tar.bz2
otp-254e58d2f4799e40be1188d95d59cdc7a616f5d9.zip
Added tests for lists:droplast/1 to stdlib/lists_SUITE
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r--lib/stdlib/test/lists_SUITE.erl12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/stdlib/test/lists_SUITE.erl b/lib/stdlib/test/lists_SUITE.erl
index 92253ef5b9..f4589a8e24 100644
--- a/lib/stdlib/test/lists_SUITE.erl
+++ b/lib/stdlib/test/lists_SUITE.erl
@@ -61,7 +61,7 @@
zip_unzip/1, zip_unzip3/1, zipwith/1, zipwith3/1,
filter_partition/1,
otp_5939/1, otp_6023/1, otp_6606/1, otp_7230/1,
- suffix/1, subtract/1]).
+ suffix/1, subtract/1, droplast/1]).
%% Sort randomized lists until stopped.
%%
@@ -2641,4 +2641,12 @@ sub_non_matching(A, B) ->
sub(A, B) ->
Res = A -- B,
Res = lists:subtract(A, B).
-
+
+%% Test lists:droplast/1
+droplast(Config) when is_list(Config) ->
+ ?line [] = lists:droplast([x]),
+ ?line [x] = lists:droplast([x, y]),
+ ?line {'EXIT', {function_clause, _}} = (catch lists:droplast([])),
+ ?line {'EXIT', {function_clause, _}} = (catch lists:droplast(x)),
+
+ ok.