diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c099bba..54ae6efe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,15 +16,14 @@ jobs: strategy: matrix: include: - - elixir: 1.12.x + - elixir: 1.13.x otp: 24.x coverage: true + sobelow: true dialyzer: true - - elixir: 1.11.x + - elixir: 1.10.x otp: 23.x inch-report: true - - elixir: 1.9.x - otp: 22.x env: GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' @@ -41,7 +40,8 @@ jobs: experimental-otp: true - name: Cache deps - uses: actions/cache@v1 + uses: actions/cache@v3 + id: mix-cache with: path: deps key: >- @@ -51,7 +51,7 @@ jobs: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix- - name: Cache _build - uses: actions/cache@v1 + uses: actions/cache@v3 with: path: _build key: >- @@ -65,6 +65,7 @@ jobs: mix local.hex --force mix local.rebar --force mix deps.get + if: ${{ steps.mix-cache.outputs.cache-hit != 'true' }} - name: Run style and code consistency checks run: | @@ -76,28 +77,38 @@ jobs: run: | epmd -daemon mix test --trace - if: ${{!matrix.coverage}} + if: ${{ !matrix.coverage }} - name: Run tests with coverage run: | epmd -daemon mix coveralls.github - if: ${{matrix.coverage}} + if: ${{ matrix.coverage }} - - name: Cache PLT - uses: actions/cache@v1 + - name: Run sobelow + run: mix sobelow --exit --skip + if: ${{ matrix.sobelow }} + + - name: Retrieve PLT Cache + uses: actions/cache@v3 + id: plt-cache with: path: priv/plts - key: '${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt-v4' - restore-keys: | - ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt-v4 + key: >- + ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plts-${{ + hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}-v1 + if: ${{ matrix.dialyzer }} - - name: Run static analysis checks + - name: Create PLTs run: | - mix sobelow --exit --skip - mix dialyzer --format short - if: ${{matrix.dialyzer}} + mkdir -p priv/plts + mix dialyzer --plt + if: ${{ matrix.dialyzer && steps.plt-cache.outputs.cache-hit != 'true' }} + + - name: Run dialyzer + run: mix dialyzer --no-check --halt-exit-status + if: ${{ matrix.dialyzer && steps.plt-cache.outputs.cache-hit != 'true' }} - - name: Doc Coverage Report + - name: Doc coverage report run: MIX_ENV=docs mix inch.report - if: ${{matrix.inch-report}} + if: ${{ matrix.inch-report }} diff --git a/README.md b/README.md index e722f2e8..96846c06 100644 --- a/README.md +++ b/README.md @@ -47,16 +47,16 @@ Partitioned | [Nebulex.Adapters.Partitioned][pa] | Built-In Replicated | [Nebulex.Adapters.Replicated][ra] | Built-In Multilevel | [Nebulex.Adapters.Multilevel][ma] | Built-In Nil (special adapter that disables the cache) | [Nebulex.Adapters.Nil][nil] | Built-In -Cachex | Nebulex.Adapters.Cachex | [nebulex_adapters_cachex][nbx_cachex] Redis | NebulexRedisAdapter | [nebulex_redis_adapter][nbx_redis] +Cachex | Nebulex.Adapters.Cachex | [nebulex_adapters_cachex][nbx_cachex] [la]: http://hexdocs.pm/nebulex/Nebulex.Adapters.Local.html [pa]: http://hexdocs.pm/nebulex/Nebulex.Adapters.Partitioned.html [ra]: http://hexdocs.pm/nebulex/Nebulex.Adapters.Replicated.html [ma]: http://hexdocs.pm/nebulex/Nebulex.Adapters.Multilevel.html [nil]: http://hexdocs.pm/nebulex/Nebulex.Adapters.Nil.html -[nbx_cachex]: https://github.com/cabol/nebulex_adapters_cachex [nbx_redis]: https://github.com/cabol/nebulex_redis_adapter +[nbx_cachex]: https://github.com/cabol/nebulex_adapters_cachex For example, if you want to use a built-in cache, add to your `mix.exs` file: diff --git a/coveralls.json b/coveralls.json index a9713911..f56f12f2 100644 --- a/coveralls.json +++ b/coveralls.json @@ -4,6 +4,7 @@ }, "skip_files": [ + "lib/nebulex/cache/options.ex", "test/support/*", "test/dialyzer/*" ] diff --git a/lib/nebulex/adapter/persistence.ex b/lib/nebulex/adapter/persistence.ex index e7fccfe8..5842453b 100644 --- a/lib/nebulex/adapter/persistence.ex +++ b/lib/nebulex/adapter/persistence.ex @@ -53,7 +53,6 @@ defmodule Nebulex.Adapter.Persistence do import Nebulex.Helpers - # sobelow_skip ["Traversal.FileModule"] @impl true def dump(%{cache: cache}, path, opts) do with_file(path, [:read, :write], fn io_dev -> @@ -64,13 +63,13 @@ defmodule Nebulex.Adapter.Persistence do |> Stream.chunk_every(Keyword.get(opts, :entries_per_line, 10)) |> Enum.each(fn entries -> bin = Entry.encode(entries, get_compression(opts)) + :ok = IO.puts(io_dev, bin) end) end end) end - # sobelow_skip ["Traversal.FileModule"] @impl true def load(%{cache: cache}, path, opts) do with_file(path, [:read], fn io_dev -> @@ -79,6 +78,7 @@ defmodule Nebulex.Adapter.Persistence do |> Stream.map(&String.trim/1) |> Enum.each(fn line -> entries = Entry.decode(line, [:safe]) + cache.put_all(entries, opts) end) end) @@ -88,6 +88,7 @@ defmodule Nebulex.Adapter.Persistence do ## Helpers + # sobelow_skip ["Traversal.FileModule"] defp with_file(path, modes, function) do case File.open(path, modes) do {:ok, io_device} -> @@ -99,6 +100,7 @@ defmodule Nebulex.Adapter.Persistence do {:error, reason} -> reason = %File.Error{reason: reason, action: "open", path: path} + wrap_error Nebulex.Error, reason: reason end end diff --git a/lib/nebulex/adapter/transaction.ex b/lib/nebulex/adapter/transaction.ex index fa83b098..c8767497 100644 --- a/lib/nebulex/adapter/transaction.ex +++ b/lib/nebulex/adapter/transaction.ex @@ -123,9 +123,11 @@ defmodule Nebulex.Adapter.Transaction do true -> try do _ = Process.put({pid, self()}, %{keys: keys, nodes: nodes}) + {:ok, fun.()} after _ = Process.delete({pid, self()}) + del_locks(ids, nodes) end diff --git a/lib/nebulex/cache/supervisor.ex b/lib/nebulex/cache/supervisor.ex index bd513676..d4efb035 100644 --- a/lib/nebulex/cache/supervisor.ex +++ b/lib/nebulex/cache/supervisor.ex @@ -11,6 +11,7 @@ defmodule Nebulex.Cache.Supervisor do """ def start_link(cache, otp_app, adapter, opts) do sup_opts = if name = Keyword.get(opts, :name, cache), do: [name: name], else: [] + Supervisor.start_link(__MODULE__, {cache, otp_app, adapter, opts}, sup_opts) end diff --git a/lib/nebulex/caching.ex b/lib/nebulex/caching.ex index 05a2838f..09402696 100644 --- a/lib/nebulex/caching.ex +++ b/lib/nebulex/caching.ex @@ -728,17 +728,20 @@ if Code.ensure_loaded?(Decorator.Define) do **NOTE:** Internal purposes only. """ - @spec eval_cache_evict(boolean, boolean, module, keygen, [term], on_error, fun) :: term + @spec eval_cache_evict(boolean, boolean, module, keygen, [term] | nil, on_error, fun) :: term def eval_cache_evict(before_invocation?, all_entries?, cache, keygen, keys, on_error, block_fun) def eval_cache_evict(true, all_entries?, cache, keygen, keys, on_error, block_fun) do _ = do_evict(all_entries?, cache, keygen, keys, on_error) + block_fun.() end def eval_cache_evict(false, all_entries?, cache, keygen, keys, on_error, block_fun) do result = block_fun.() + _ = do_evict(all_entries?, cache, keygen, keys, on_error) + result end @@ -765,10 +768,12 @@ if Code.ensure_loaded?(Decorator.Define) do case match.(result) do {true, value} -> _ = run_cmd(__MODULE__, :cache_put, [cache, key, value, opts], on_error) + result true -> _ = run_cmd(__MODULE__, :cache_put, [cache, key, result, opts], on_error) + result false -> @@ -785,8 +790,9 @@ if Code.ensure_loaded?(Decorator.Define) do def cache_put(cache, key, value, opts) def cache_put(cache, {:"$keys", keys}, value, opts) do - entries = for k <- keys, do: {k, value} - cache.put_all(entries, opts) + keys + |> Enum.map(&{&1, value}) + |> cache.put_all(opts) end def cache_put(cache, key, value, opts) do diff --git a/lib/nebulex/entry.ex b/lib/nebulex/entry.ex index d6665408..c52255cb 100644 --- a/lib/nebulex/entry.ex +++ b/lib/nebulex/entry.ex @@ -33,8 +33,11 @@ defmodule Nebulex.Entry do ## Example - iex> Nebulex.Entry.encode(%Nebulex.Entry{}) - _encoded_entry + iex> "hello" + ...> |> Nebulex.Entry.encode() + ...> |> Nebulex.Entry.decode() + "hello" + """ @spec encode(term, [term]) :: binary def encode(data, opts \\ []) do @@ -48,10 +51,11 @@ defmodule Nebulex.Entry do ## Example - iex> %Nebulex.Entry{} + iex> "hello" ...> |> Nebulex.Entry.encode() ...> |> Nebulex.Entry.decode() - _decoded_entry + "hello" + """ # sobelow_skip ["Misc.BinToTerm"] @spec decode(binary, [term]) :: term @@ -68,6 +72,12 @@ defmodule Nebulex.Entry do iex> Nebulex.Entry.expired?(%Nebulex.Entry{}) false + + iex> Nebulex.Entry.expired?( + ...> %Nebulex.Entry{touched: Nebulex.Time.now() - 10, ttl: 1} + ...> ) + true + """ @spec expired?(t) :: boolean def expired?(%__MODULE__{ttl: :infinity}), do: false @@ -83,6 +93,14 @@ defmodule Nebulex.Entry do iex> Nebulex.Entry.ttl(%Nebulex.Entry{}) :infinity + + iex> ttl = + ...> Nebulex.Entry.ttl( + ...> %Nebulex.Entry{touched: Nebulex.Time.now(), ttl: 100} + ...> ) + iex> ttl > 0 + true + """ @spec ttl(t) :: timeout def ttl(%__MODULE__{ttl: :infinity}), do: :infinity diff --git a/lib/nebulex/helpers.ex b/lib/nebulex/helpers.ex index 25145cf8..5891a774 100644 --- a/lib/nebulex/helpers.ex +++ b/lib/nebulex/helpers.ex @@ -16,18 +16,6 @@ defmodule Nebulex.Helpers do end end - @spec get_boolean_option(keyword, atom, boolean) :: term - def get_boolean_option(opts, key, default \\ false) - when is_list(opts) and is_atom(key) and is_boolean(default) do - value = Keyword.get(opts, key, default) - - if is_boolean(value) do - value - else - raise ArgumentError, "expected #{key}: to be boolean, got: #{inspect(value)}" - end - end - @spec assert_behaviour(module, module, binary) :: module def assert_behaviour(module, behaviour, msg \\ "module") do if behaviour in module_behaviours(module, msg) do @@ -70,15 +58,14 @@ defmodule Nebulex.Helpers do end end + # FIXME: this is because coveralls does not mark this as covered + # coveralls-ignore-start + @doc false defmacro wrap_ok(call) do - # FIXME: this is because coveralls does not mark this as covered - # coveralls-ignore-start quote do {:ok, unquote(call)} end - - # coveralls-ignore-stop end @doc false @@ -87,4 +74,6 @@ defmodule Nebulex.Helpers do {:error, unquote(exception).exception(unquote(opts))} end end + + # coveralls-ignore-stop end diff --git a/lib/nebulex/telemetry/stats_handler.ex b/lib/nebulex/telemetry/stats_handler.ex index 36ed4460..74928f3e 100644 --- a/lib/nebulex/telemetry/stats_handler.ex +++ b/lib/nebulex/telemetry/stats_handler.ex @@ -16,10 +16,14 @@ defmodule Nebulex.Telemetry.StatsHandler do update_stats(metadata) end + # coveralls-ignore-start + def handle_event(_event, _measurements, _metadata, _ref) do :ok end + # coveralls-ignore-stop + defp update_stats(%{ function_name: action, result: {:error, %Nebulex.KeyError{reason: :expired}}, diff --git a/lib/nebulex/time.ex b/lib/nebulex/time.ex index 99fd9387..c1191992 100644 --- a/lib/nebulex/time.ex +++ b/lib/nebulex/time.ex @@ -15,8 +15,10 @@ defmodule Nebulex.Time do ## Examples - iex> Nebulex.Time.now() - _milliseconds + iex> now = Nebulex.Time.now() + iex> is_integer(now) and now > 0 + true + """ @spec now(System.time_unit()) :: integer() defdelegate now(unit \\ :millisecond), to: System, as: :system_time @@ -37,6 +39,10 @@ defmodule Nebulex.Time do iex> Nebulex.Time.timeout?(-1) false + + iex> Nebulex.Time.timeout?(1.1) + false + """ @spec timeout?(term) :: boolean def timeout?(timeout) do diff --git a/mix.exs b/mix.exs index 1b4334c6..d987d60b 100644 --- a/mix.exs +++ b/mix.exs @@ -2,7 +2,7 @@ defmodule Nebulex.MixProject do use Mix.Project @source_url "https://github.com/cabol/nebulex" - @version "2.3.1" + @version "3.0.0-dev" def project do [ @@ -57,17 +57,17 @@ defmodule Nebulex.MixProject do {:ex2ms, "~> 1.6", only: :test}, {:mock, "~> 0.3", only: :test}, {:excoveralls, "~> 0.14", only: :test}, - {:credo, "~> 1.5", only: [:dev, :test], runtime: false}, + {:credo, "~> 1.6", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.1", only: [:dev, :test], runtime: false}, {:sobelow, "~> 0.11", only: [:dev, :test], runtime: false}, {:stream_data, "~> 0.5", only: [:dev, :test]}, # Benchmark Test - {:benchee, "~> 1.0", only: [:dev, :test]}, + {:benchee, "~> 1.1", only: [:dev, :test]}, {:benchee_html, "~> 1.0", only: [:dev, :test]}, # Docs - {:ex_doc, "~> 0.24", only: [:dev, :test], runtime: false}, + {:ex_doc, "~> 0.28", only: [:dev, :test], runtime: false}, {:inch_ex, "~> 2.0", only: :docs} ] end diff --git a/mix.lock b/mix.lock index bbc9c3a2..e8f5b2ba 100644 --- a/mix.lock +++ b/mix.lock @@ -1,17 +1,17 @@ %{ - "benchee": {:hex, :benchee, "1.0.1", "66b211f9bfd84bd97e6d1beaddf8fc2312aaabe192f776e8931cb0c16f53a521", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}], "hexpm", "3ad58ae787e9c7c94dd7ceda3b587ec2c64604563e049b2a0e8baafae832addb"}, + "benchee": {:hex, :benchee, "1.1.0", "f3a43817209a92a1fade36ef36b86e1052627fd8934a8b937ac9ab3a76c43062", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:statistex, "~> 1.0", [hex: :statistex, repo: "hexpm", optional: false]}], "hexpm", "7da57d545003165a012b587077f6ba90b89210fd88074ce3c60ce239eb5e6d93"}, "benchee_html": {:hex, :benchee_html, "1.0.0", "5b4d24effebd060f466fb460ec06576e7b34a00fc26b234fe4f12c4f05c95947", [:mix], [{:benchee, ">= 0.99.0 and < 2.0.0", [hex: :benchee, repo: "hexpm", optional: false]}, {:benchee_json, "~> 1.0", [hex: :benchee_json, repo: "hexpm", optional: false]}], "hexpm", "5280af9aac432ff5ca4216d03e8a93f32209510e925b60e7f27c33796f69e699"}, "benchee_json": {:hex, :benchee_json, "1.0.0", "cc661f4454d5995c08fe10dd1f2f72f229c8f0fb1c96f6b327a8c8fc96a91fe5", [:mix], [{:benchee, ">= 0.99.0 and < 2.0.0", [hex: :benchee, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "da05d813f9123505f870344d68fb7c86a4f0f9074df7d7b7e2bb011a63ec231c"}, "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"}, "certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"}, - "credo": {:hex, :credo, "1.6.3", "0a9f8925dbc8f940031b789f4623fc9a0eea99d3eed600fe831e403eb96c6a83", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "1167cde00e6661d740fc54da2ee268e35d3982f027399b64d3e2e83af57a1180"}, + "credo": {:hex, :credo, "1.6.4", "ddd474afb6e8c240313f3a7b0d025cc3213f0d171879429bf8535d7021d9ad78", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "c28f910b61e1ff829bffa056ef7293a8db50e87f2c57a9b5c3f57eee124536b7"}, "decorator": {:hex, :decorator, "1.4.0", "a57ac32c823ea7e4e67f5af56412d12b33274661bb7640ec7fc882f8d23ac419", [:mix], [], "hexpm", "0a07cedd9083da875c7418dea95b78361197cf2bf3211d743f6f7ce39656597f"}, "deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"}, "dialyxir": {:hex, :dialyxir, "1.1.0", "c5aab0d6e71e5522e77beff7ba9e08f8e02bad90dfbeffae60eaf0cb47e29488", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "07ea8e49c45f15264ebe6d5b93799d4dd56a44036cf42d0ad9c960bc266c0b9a"}, - "earmark_parser": {:hex, :earmark_parser, "1.4.19", "de0d033d5ff9fc396a24eadc2fcf2afa3d120841eb3f1004d138cbf9273210e8", [:mix], [], "hexpm", "527ab6630b5c75c3a3960b75844c314ec305c76d9899bb30f71cb85952a9dc45"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.25", "2024618731c55ebfcc5439d756852ec4e85978a39d0d58593763924d9a15916f", [:mix], [], "hexpm", "56749c5e1c59447f7b7a23ddb235e4b3defe276afc220a6227237f3efe83f51e"}, "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, "ex2ms": {:hex, :ex2ms, "1.6.1", "66d472eb14da43087c156e0396bac3cc7176b4f24590a251db53f84e9a0f5f72", [:mix], [], "hexpm", "a7192899d84af03823a8ec2f306fa858cbcce2c2e7fd0f1c49e05168fb9c740e"}, - "ex_doc": {:hex, :ex_doc, "0.28.0", "7eaf526dd8c80ae8c04d52ac8801594426ae322b52a6156cd038f30bafa8226f", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "e55cdadf69a5d1f4cfd8477122ebac5e1fadd433a8c1022dafc5025e48db0131"}, + "ex_doc": {:hex, :ex_doc, "0.28.3", "6eea2f69995f5fba94cd6dd398df369fe4e777a47cd887714a0976930615c9e6", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "05387a6a2655b5f9820f3f627450ed20b4325c25977b2ee69bed90af6688e718"}, "excoveralls": {:hex, :excoveralls, "0.14.4", "295498f1ae47bdc6dce59af9a585c381e1aefc63298d48172efaaa90c3d251db", [:mix], [{:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "e3ab02f2df4c1c7a519728a6f0a747e71d7d6e846020aae338173619217931c1"}, "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, "hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~>2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"}, @@ -19,18 +19,19 @@ "inch_ex": {:hex, :inch_ex, "2.0.0", "24268a9284a1751f2ceda569cd978e1fa394c977c45c331bb52a405de544f4de", [:mix], [{:bunt, "~> 0.2", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "96d0ec5ecac8cf63142d02f16b7ab7152cf0f0f1a185a80161b758383c9399a8"}, "jason": {:hex, :jason, "1.3.0", "fa6b82a934feb176263ad2df0dbd91bf633d4a46ebfdffea0c8ae82953714946", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "53fc1f51255390e0ec7e50f9cb41e751c260d065dcba2bf0d08dc51a4002c2ac"}, "makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"}, - "makeup_elixir": {:hex, :makeup_elixir, "0.15.2", "dc72dfe17eb240552857465cc00cce390960d9a0c055c4ccd38b70629227e97c", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "fd23ae48d09b32eff49d4ced2b43c9f086d402ee4fd4fcb2d7fad97fa8823e75"}, + "makeup_elixir": {:hex, :makeup_elixir, "0.16.0", "f8c570a0d33f8039513fbccaf7108c5d750f47d8defd44088371191b76492b0b", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "28b2cbdc13960a46ae9a8858c4bebdec3c9a6d7b4b9e7f4ed1502f8159f338e7"}, "makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"}, "meck": {:hex, :meck, "0.9.2", "85ccbab053f1db86c7ca240e9fc718170ee5bda03810a6292b5306bf31bae5f5", [:rebar3], [], "hexpm", "81344f561357dc40a8344afa53767c32669153355b626ea9fcbc8da6b3045826"}, "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"}, "mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"}, "mock": {:hex, :mock, "0.3.7", "75b3bbf1466d7e486ea2052a73c6e062c6256fb429d6797999ab02fa32f29e03", [:mix], [{:meck, "~> 0.9.2", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm", "4da49a4609e41fd99b7836945c26f373623ea968cfb6282742bcb94440cf7e5c"}, "nimble_options": {:hex, :nimble_options, "0.4.0", "c89babbab52221a24b8d1ff9e7d838be70f0d871be823165c94dd3418eea728f", [:mix], [], "hexpm", "e6701c1af326a11eea9634a3b1c62b475339ace9456c1a23ec3bc9a847bca02d"}, - "nimble_parsec": {:hex, :nimble_parsec, "1.2.2", "b99ca56bbce410e9d5ee4f9155a212e942e224e259c7ebbf8f2c86ac21d4fa3c", [:mix], [], "hexpm", "98d51bd64d5f6a2a9c6bb7586ee8129e27dfaab1140b5a4753f24dac0ba27d2f"}, + "nimble_parsec": {:hex, :nimble_parsec, "1.2.3", "244836e6e3f1200c7f30cb56733fd808744eca61fd182f731eac4af635cc6d0b", [:mix], [], "hexpm", "c8d789e39b9131acf7b99291e93dae60ab48ef14a7ee9d58c6964f59efb570b0"}, "parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"}, "shards": {:hex, :shards, "1.0.1", "1bdbbf047db27f3c3eb800a829d4a47062c84d5543cbfebcfc4c14d038bf9220", [:make, :rebar3], [], "hexpm", "2c57788afbf053c4024366772892beee89b8b72e884e764fb0a075dfa7442041"}, "sobelow": {:hex, :sobelow, "0.11.1", "23438964486f8112b41e743bbfd402da3e5b296fdc9eacab29914b79c48916dd", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "9897363a7eff96f4809304a90aad819e2ad5e5d24db547af502885146746a53c"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"}, + "statistex": {:hex, :statistex, "1.0.0", "f3dc93f3c0c6c92e5f291704cf62b99b553253d7969e9a5fa713e5481cd858a5", [:mix], [], "hexpm", "ff9d8bee7035028ab4742ff52fc80a2aa35cece833cf5319009b52f1b5a86c27"}, "stream_data": {:hex, :stream_data, "0.5.0", "b27641e58941685c75b353577dc602c9d2c12292dd84babf506c2033cd97893e", [:mix], [], "hexpm", "012bd2eec069ada4db3411f9115ccafa38540a3c78c4c0349f151fc761b9e271"}, "telemetry": {:hex, :telemetry, "1.0.0", "0f453a102cdf13d506b7c0ab158324c337c41f1cc7548f0bc0e130bbf0ae9452", [:rebar3], [], "hexpm", "73bc09fa59b4a0284efb4624335583c528e07ec9ae76aca96ea0673850aec57a"}, "unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"}, diff --git a/test/nebulex/entry_test.exs b/test/nebulex/entry_test.exs new file mode 100644 index 00000000..4adcb660 --- /dev/null +++ b/test/nebulex/entry_test.exs @@ -0,0 +1,4 @@ +defmodule Nebulex.EntryTest do + use ExUnit.Case, async: true + doctest Nebulex.Entry +end diff --git a/test/nebulex/time_test.exs b/test/nebulex/time_test.exs index b7fa0608..5d15d86b 100644 --- a/test/nebulex/time_test.exs +++ b/test/nebulex/time_test.exs @@ -1,18 +1,4 @@ defmodule Nebulex.TimeTest do use ExUnit.Case, async: true - - alias Nebulex.Time - - test "now" do - now = Time.now() - assert is_integer(now) and now > 0 - end - - test "timeout?" do - assert Time.timeout?(1) - assert Time.timeout?(:infinity) - refute Time.timeout?(-1) - refute Time.timeout?(1.1) - refute Time.timeout?("1") - end + doctest Nebulex.Entry end