From 5ac794dac84ab902d8b5e9e84e25f38a639cb1e6 Mon Sep 17 00:00:00 2001 From: NicklasXYZ Date: Wed, 20 Mar 2024 22:40:30 +0100 Subject: [PATCH] fix docs + add another test case --- src/gleam_community/maths/predicates.gleam | 1 + test/gleam_community/maths/predicates_test.gleam | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/gleam_community/maths/predicates.gleam b/src/gleam_community/maths/predicates.gleam index ca81d33..c5d5f01 100644 --- a/src/gleam_community/maths/predicates.gleam +++ b/src/gleam_community/maths/predicates.gleam @@ -33,6 +33,7 @@ //// * [`is_perfect`](#is_perfect) //// * [`is_even`](#is_even) //// * [`is_odd`](#is_odd) +//// * [`is_prime`](#is_prime) import gleam/pair import gleam/int diff --git a/test/gleam_community/maths/predicates_test.gleam b/test/gleam_community/maths/predicates_test.gleam index 4130aab..b2e6d57 100644 --- a/test/gleam_community/maths/predicates_test.gleam +++ b/test/gleam_community/maths/predicates_test.gleam @@ -138,6 +138,10 @@ pub fn int_is_perfect_test() { } pub fn int_is_prime_test() { + // Test a negative integer, i.e., not a natural number + predicates.is_prime(-7) + |> should.equal(False) + predicates.is_prime(1) |> should.equal(False)