this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: Add `Option` assertions

authored by

Bernat Jufré and committed by
Louis Pilfold
78d3d822 8b66cd03

+19
+4
CHANGELOG.md
··· 1 1 # Changelog 2 2 3 + ## v1.1.0 4 + 5 + - Added `Option` assertions: `should.be_some` and `should.be_none` 6 + 3 7 ## v1.0.2 - 2023-12-19 4 8 5 9 - Added Gleam v0.33.0 version requirement.
+15
src/gleeunit/should.gleam
··· 5 5 //// documentation](https://rebar3.org/docs/testing/eunit/). 6 6 7 7 import gleam/string 8 + import gleam/option.{type Option, None, Some} 8 9 9 10 @external(erlang, "gleeunit_ffi", "should_equal") 10 11 pub fn equal(a: t, b: t) -> Nil { ··· 47 48 case a { 48 49 Error(error) -> error 49 50 _ -> panic as string.concat(["\n", string.inspect(a), "\nshould be error"]) 51 + } 52 + } 53 + 54 + pub fn be_some(a: Option(a)) -> a { 55 + case a { 56 + Some(value) -> value 57 + _ -> panic as string.concat(["\n", string.inspect(a), "\nshould be some"]) 58 + } 59 + } 60 + 61 + pub fn be_none(a: Option(a)) -> Nil { 62 + case a { 63 + None -> Nil 64 + _ -> panic as string.concat(["\n", string.inspect(a), "\nshould be none"]) 50 65 } 51 66 } 52 67