aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Jones <m.pricejones@gmail.com>2021-08-09 19:25:10 +0100
committerLouis Pilfold <louis@lpil.uk>2021-08-09 20:20:36 +0100
commit9579b1c5623d1ef620a7e3521cd9a3d0443b10d6 (patch)
tree879915e0c42ff780094c677cc97b87ad15b720f1 /src
parent3668e37eab76a7af5939b005e9fc63386a2a2d40 (diff)
downloadgleam_stdlib-9579b1c5623d1ef620a7e3521cd9a3d0443b10d6.tar.gz
gleam_stdlib-9579b1c5623d1ef620a7e3521cd9a3d0443b10d6.zip
Fix doc tests
Various tests that are incorrect and can be adjusted to pass.
Diffstat (limited to 'src')
-rw-r--r--src/gleam/float.gleam2
-rw-r--r--src/gleam/list.gleam10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/gleam/float.gleam b/src/gleam/float.gleam
index d0121a2..43229c4 100644
--- a/src/gleam/float.gleam
+++ b/src/gleam/float.gleam
@@ -217,7 +217,7 @@ pub fn absolute_value(float: Float) -> Float {
/// 4.0
///
/// > power(8.0, 1.5)
-/// 64.0
+/// 22.627416997969522
///
pub fn power(base: Float, exponent: Float) -> Float {
do_power(base, exponent)
diff --git a/src/gleam/list.gleam b/src/gleam/list.gleam
index 9254c7f..b667953 100644
--- a/src/gleam/list.gleam
+++ b/src/gleam/list.gleam
@@ -138,7 +138,7 @@ pub fn is_empty(list: List(a)) -> Bool {
/// ## Examples
///
/// > [] |> contains(any: 0)
-/// True
+/// False
///
/// > [0] |> contains(any: 0)
/// True
@@ -256,7 +256,7 @@ fn do_filter_map(
/// []
///
/// > filter_map([2, 4, 6, 1], fn(x) { Ok(x + 1) })
-/// [3, 4, 6, 2]
+/// [3, 5, 7, 2]
///
pub fn filter_map(list: List(a), with fun: fn(a) -> Result(b, e)) -> List(b) {
do_filter_map(list, fun, [])
@@ -754,11 +754,11 @@ pub fn all(in list: List(a), satisfying predicate: fn(a) -> Bool) -> Bool {
/// False
///
/// > any([4, 5], fn(x) { x > 3 })
-/// False
-///
-/// > any([4, 3], fn(x) { x > 3 })
/// True
///
+/// > any([4, 3], fn(x) { x > 4 })
+/// False
+///
/// > any([3, 4], fn(x) { x > 3 })
/// True
///