Skip to content

Commit

Permalink
Add some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwinchester committed Mar 31, 2024
1 parent 3914614 commit 552a9d0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The package can be installed by adding `uuid_v7` to your list of dependencies in
```elixir
def deps do
[
{:uuid_v7, "~> 0.2.0"}
{:uuid_v7, "~> 0.2.1"}
]
end
```
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule UUIDv7.MixProject do
def project do
[
app: :uuid_v7,
version: "0.2.0",
version: "0.2.1",
elixir: "~> 1.16",
start_permanent: Mix.env() == :prod,
deps: deps(),
Expand Down
23 changes: 23 additions & 0 deletions test/uuidv7/ordered_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
defmodule UUIDv7.OrderedTest do
use ExUnit.Case, async: true

test "generate/1 is ordered" do
uuids =
for _ <- 1..100 do
UUIDv7.generate()
:timer.sleep(1)
end

assert uuids == Enum.sort(uuids)
end

test "bingenerate/1 is ordered" do
uuids =
for _ <- 1..100 do
UUIDv7.bingenerate()
:timer.sleep(1)
end

assert uuids == Enum.sort(uuids)
end
end

0 comments on commit 552a9d0

Please sign in to comment.