diff options
author | Fredrik Gustafsson <[email protected]> | 2013-10-22 09:53:52 +0200 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2013-10-22 09:53:52 +0200 |
commit | aa3d0613b1e67f378ee11838f67e7cfbe1bc5928 (patch) | |
tree | 10bf9be0748bf57d5ed4d7b78ab1417b834ce10d /lib/stdlib/test | |
parent | a6141d40a3596090c41f7e52537eaab2e733510c (diff) | |
parent | e6757fb65ef28f6b4b16d626f119bd162c415a81 (diff) | |
download | otp-aa3d0613b1e67f378ee11838f67e7cfbe1bc5928.tar.gz otp-aa3d0613b1e67f378ee11838f67e7cfbe1bc5928.tar.bz2 otp-aa3d0613b1e67f378ee11838f67e7cfbe1bc5928.zip |
Merge branch 'mh/dict_orddict_is_empty/OTP-11353'
* mh/dict_orddict_is_empty/OTP-11353:
Update primary bootstrap
Add dict:is_empty/1 and orddict:is_empty/1
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r-- | lib/stdlib/test/dict_SUITE.erl | 11 | ||||
-rw-r--r-- | lib/stdlib/test/dict_test_lib.erl | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/stdlib/test/dict_SUITE.erl b/lib/stdlib/test/dict_SUITE.erl index 0223240479..69814e12ce 100644 --- a/lib/stdlib/test/dict_SUITE.erl +++ b/lib/stdlib/test/dict_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -%% This module tests the ordsets, sets, and gb_sets modules. +%% This module tests the orddict, dict, and gb_trees modules. %% -module(dict_SUITE). @@ -68,6 +68,7 @@ create_1(M) -> D0 = M(empty, []), [] = M(to_list, D0), 0 = M(size, D0), + true = M(is_empty, D0), D0. store(Config) when is_list(Config) -> @@ -81,6 +82,14 @@ store_1(List, M) -> D1 = foldl(fun({K,V}, Dict) -> M(enter, {K,V,Dict}) end, M(empty, []), List), true = M(equal, {D0,D1}), + case List of + [] -> + true = M(is_empty, D0), + true = M(is_empty, D1); + [_|_] -> + false = M(is_empty, D0), + false = M(is_empty, D1) + end, D0. %%% diff --git a/lib/stdlib/test/dict_test_lib.erl b/lib/stdlib/test/dict_test_lib.erl index e308fd0721..4fdb4fa0bd 100644 --- a/lib/stdlib/test/dict_test_lib.erl +++ b/lib/stdlib/test/dict_test_lib.erl @@ -28,6 +28,7 @@ new(Mod, Eq) -> (from_list, L) -> from_list(Mod, L); (module, []) -> Mod; (size, D) -> Mod:size(D); + (is_empty, D) -> Mod:is_empty(D); (to_list, D) -> to_list(Mod, D) end. |