From ece5faa69da724ddfdee7b92016bac73dbdbff70 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 4 Jul 2018 11:10:50 +0200 Subject: Tests --- test/conn_test.exs | 4 ---- test/mkllst_test.exs | 7 ++++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/test/conn_test.exs b/test/conn_test.exs index a8cda43..ff746b7 100644 --- a/test/conn_test.exs +++ b/test/conn_test.exs @@ -5,10 +5,6 @@ defmodule ShardTest.Conn do require Salty.Box.Curve25519xchacha20poly1305, as: Box require Salty.Sign.Ed25519, as: Sign - test "the truth" do - assert 1 + 1 == 2 - end - test "crypto connection" do {:ok, srv_pkey, srv_skey} = Sign.keypair {:ok, sess_pkey, sess_skey} = Box.keypair diff --git a/test/mkllst_test.exs b/test/mkllst_test.exs index 7d1fadf..4df25df 100644 --- a/test/mkllst_test.exs +++ b/test/mkllst_test.exs @@ -5,11 +5,12 @@ defmodule ShardTest.MklLst do test "merkle list" do {:ok, pid} = GenServer.start(SData.MerkleList, &SData.MerkleList.cmp_ts_str/2) - {:ok, list, rt} = GenServer.call(pid, {:read, nil, nil}) - assert list == [] - assert rt == nil + {:ok, [], nil} = GenServer.call(pid, {:read, nil, nil}) GenServer.cast(pid, {:insert, {12, "aa, bb"}}) GenServer.cast(pid, {:insert_many, [{14, "qwerty"}, {8, "haha"}]}) + GenServer.cast(pid, {:insert, {14, "qwerty"}}) + {:ok, list, nil} = GenServer.call(pid, {:read, nil, nil}) + assert length(list) == 3 end end -- cgit v1.2.3