···77]
8899[requirements]
1010-gleam_stdlib = { version = ">= 0.60.0 and < 2.0.0" }
1010+gleam_stdlib = { version = ">= 0.60.0 and < 1.0.0" }
1111testhelper = { path = "./testhelper" }
+4-12
src/gleeunit/should.gleam
···11-//// A module for testing your Gleam code. The functions found here are
22-//// compatible with the Erlang eunit test framework.
33-////
44-//// More information on running eunit can be found in [the rebar3
55-//// documentation](https://rebar3.org/docs/testing/eunit/).
11+//// Use the `assert` keyword instead of this module.
6273import gleam/option.{type Option, None, Some}
84import gleam/string
951010-@external(erlang, "gleeunit_ffi", "should_equal")
116pub fn equal(a: t, b: t) -> Nil {
127 case a == b {
138 True -> Nil
149 _ ->
1510 panic as string.concat([
1616- "\n\t",
1111+ "\n",
1712 string.inspect(a),
1818- "\n\tshould equal \n\t",
1313+ "\nshould equal\n",
1914 string.inspect(b),
2015 ])
2116 }
2217}
23182424-@external(erlang, "gleeunit_ffi", "should_not_equal")
2519pub fn not_equal(a: t, b: t) -> Nil {
2620 case a != b {
2721 True -> Nil
···2923 panic as string.concat([
3024 "\n",
3125 string.inspect(a),
3232- "\nshould not equal \n",
2626+ "\nshould not equal\n",
3327 string.inspect(b),
3428 ])
3529 }
3630}
37313838-@external(erlang, "gleeunit_ffi", "should_be_ok")
3932pub fn be_ok(a: Result(a, e)) -> a {
4033 case a {
4134 Ok(value) -> value
···4336 }
4437}
45384646-@external(erlang, "gleeunit_ffi", "should_be_error")
4739pub fn be_error(a: Result(a, e)) -> e {
4840 case a {
4941 Error(error) -> error