From 0d4e5f87c5b1b68f6c92dc52c332b874fbfc227e Mon Sep 17 00:00:00 2001 From: Benjamin Piouffle Date: Wed, 27 Mar 2024 14:04:38 +0100 Subject: [PATCH] test: add coverage for is_burner_domain with invalid input --- test/burnex_test.exs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/burnex_test.exs b/test/burnex_test.exs index 223351c..27fa810 100644 --- a/test/burnex_test.exs +++ b/test/burnex_test.exs @@ -39,6 +39,14 @@ defmodule BurnexTest do refute Enum.any?(Burnex.providers(), &(String.downcase(&1) != &1)) end + describe "is_burner_domain" do + test "with invalid input" do + assert Burnex.is_burner_domain?(nil) + assert Burnex.is_burner_domain?(42) + assert Burnex.is_burner_domain?(%{}) + end + end + property "doesn't explode if email has bad format" do check all(email <- StreamData.string(:alphanumeric)) do refute Burnex.is_burner?(email)