Skip to content

Commit

Permalink
chore: Adding tests. #64
Browse files Browse the repository at this point in the history
  • Loading branch information
LuchoTurtle committed Nov 11, 2023
1 parent 93b6596 commit 4897c1e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/useful_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,17 @@ defmodule UsefulTest do
assert Useful.typeof(tuple) == "tuple"
end
end

describe "is_valid_url?/1" do
test "are URL valid" do
assert Useful.is_valid_url?("http://www.google.com") == true
assert Useful.is_valid_url?("http//google.com") == false
assert Useful.is_valid_url?("ftp://google.com") == true
assert Useful.is_valid_url?("https://google.com/api&url=ok") == true
assert Useful.is_valid_url?("http://localhost:3000") == true
assert Useful.is_valid_url?("https://localhost") == true
assert Useful.is_valid_url?("htt:/google") == false
assert Useful.is_valid_url?("www.google.com") == false
end
end
end

0 comments on commit 4897c1e

Please sign in to comment.