Skip to content

Commit

Permalink
Add blocklist creation test
Browse files Browse the repository at this point in the history
  • Loading branch information
tshakah committed Feb 6, 2024
1 parent a34f507 commit a361698
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/sqids_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ defmodule SqidsTest do

import SqidsTest.Shared

test "creating blocklist" do
expected_matches = ["aa", "ab", "ac"]
{:ok, %Sqids.Blocklist{} = blocklist} = Sqids.Blocklist.new(expected_matches, 1, "abc")

assert blocklist.min_word_length == 1
assert ^expected_matches = blocklist.matches_anywhere
end

for access_type <- [:"Direct API", :"Using module"] do
test "#{access_type}: if no custom blocklist param, use the default blocklist" do
{:ok, instance} = new_sqids(unquote(access_type))
Expand Down

0 comments on commit a361698

Please sign in to comment.