From 47232d0281e580403b56dd2b90b831922224367d Mon Sep 17 00:00:00 2001 From: Gilbert Wong Date: Wed, 29 Aug 2018 14:52:35 +0800 Subject: [PATCH] update emqx_lib_suite and delete duplicate test case --- test/emqx_base62_SUITE.erl | 37 ------------------------------------- test/emqx_lib_SUITE.erl | 15 ++++++++------- 2 files changed, 8 insertions(+), 44 deletions(-) delete mode 100644 test/emqx_base62_SUITE.erl diff --git a/test/emqx_base62_SUITE.erl b/test/emqx_base62_SUITE.erl deleted file mode 100644 index e303fd8ee..000000000 --- a/test/emqx_base62_SUITE.erl +++ /dev/null @@ -1,37 +0,0 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. -%% -%% Licensed under the Apache License, Version 2.0 (the "License"); -%% you may not use this file except in compliance with the License. -%% You may obtain a copy of the License at -%% -%% http://www.apache.org/licenses/LICENSE-2.0 -%% -%% Unless required by applicable law or agreed to in writing, software -%% distributed under the License is distributed on an "AS IS" BASIS, -%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -%% See the License for the specific language governing permissions and -%% limitations under the License. - --module(emqx_base62_SUITE). - --include_lib("eunit/include/eunit.hrl"). - --define(BASE62, emqx_base62). - --compile(export_all). --compile(nowarn_export_all). - -all() -> [t_base62_encode]. - -t_base62_encode(_) -> - <<"10">> = ?BASE62:decode(?BASE62:encode(<<"10">>)), - <<"100">> = ?BASE62:decode(?BASE62:encode(<<"100">>)), - <<"9999">> = ?BASE62:decode(?BASE62:encode(<<"9999">>)), - <<"65535">> = ?BASE62:decode(?BASE62:encode(<<"65535">>)), - <> = emqx_guid:gen(), - <> = emqx_guid:gen(), - X = ?BASE62:decode(?BASE62:encode(X), integer), - Y = ?BASE62:decode(?BASE62:encode(Y), integer), - <<"helloworld">> = ?BASE62:decode(?BASE62:encode("helloworld")), - "helloworld" = ?BASE62:decode(?BASE62:encode("helloworld", string), string). - diff --git a/test/emqx_lib_SUITE.erl b/test/emqx_lib_SUITE.erl index 72153f6b3..12bbd023e 100644 --- a/test/emqx_lib_SUITE.erl +++ b/test/emqx_lib_SUITE.erl @@ -161,12 +161,13 @@ node_parse_name(_) -> %%-------------------------------------------------------------------- base62_encode(_) -> - 10 = ?BASE62:decode(?BASE62:encode(10)), - 100 = ?BASE62:decode(?BASE62:encode(100)), - 9999 = ?BASE62:decode(?BASE62:encode(9999)), - 65535 = ?BASE62:decode(?BASE62:encode(65535)), + <<"10">> = ?BASE62:decode(?BASE62:encode(<<"10">>)), + <<"100">> = ?BASE62:decode(?BASE62:encode(<<"100">>)), + <<"9999">> = ?BASE62:decode(?BASE62:encode(<<"9999">>)), + <<"65535">> = ?BASE62:decode(?BASE62:encode(<<"65535">>)), <> = emqx_guid:gen(), <> = emqx_guid:gen(), - X = ?BASE62:decode(?BASE62:encode(X)), - Y = ?BASE62:decode(?BASE62:encode(Y)). - + X = ?BASE62:decode(?BASE62:encode(X), integer), + Y = ?BASE62:decode(?BASE62:encode(Y), integer), + <<"helloworld">> = ?BASE62:decode(?BASE62:encode("helloworld")), + "helloworld" = ?BASE62:decode(?BASE62:encode("helloworld", string), string).