this repo has no description
0
fork

Configure Feed

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

Improve old style assertions

+9 -18
+1 -1
.github/workflows/test.yml
··· 14 14 - uses: erlef/setup-beam@v1 15 15 with: 16 16 otp-version: "25.1" 17 - gleam-version: "1.2.0" 17 + gleam-version: "1.11.0" 18 18 - uses: denoland/setup-deno@v1 19 19 with: 20 20 deno-version: v1.x
+1 -1
gleam.toml
··· 10 10 allow_read = ["gleam.toml", "test", "build"] 11 11 12 12 [dependencies] 13 - gleam_stdlib = ">= 0.60.0 and < 2.0.0" 13 + gleam_stdlib = ">= 0.60.0 and < 1.0.0" 14 14 15 15 [dev-dependencies] 16 16 testhelper = { "path" = "./testhelper" }
+1 -1
manifest.toml
··· 7 7 ] 8 8 9 9 [requirements] 10 - gleam_stdlib = { version = ">= 0.60.0 and < 2.0.0" } 10 + gleam_stdlib = { version = ">= 0.60.0 and < 1.0.0" } 11 11 testhelper = { path = "./testhelper" }
+4 -12
src/gleeunit/should.gleam
··· 1 - //// A module for testing your Gleam code. The functions found here are 2 - //// compatible with the Erlang eunit test framework. 3 - //// 4 - //// More information on running eunit can be found in [the rebar3 5 - //// documentation](https://rebar3.org/docs/testing/eunit/). 1 + //// Use the `assert` keyword instead of this module. 6 2 7 3 import gleam/option.{type Option, None, Some} 8 4 import gleam/string 9 5 10 - @external(erlang, "gleeunit_ffi", "should_equal") 11 6 pub fn equal(a: t, b: t) -> Nil { 12 7 case a == b { 13 8 True -> Nil 14 9 _ -> 15 10 panic as string.concat([ 16 - "\n\t", 11 + "\n", 17 12 string.inspect(a), 18 - "\n\tshould equal \n\t", 13 + "\nshould equal\n", 19 14 string.inspect(b), 20 15 ]) 21 16 } 22 17 } 23 18 24 - @external(erlang, "gleeunit_ffi", "should_not_equal") 25 19 pub fn not_equal(a: t, b: t) -> Nil { 26 20 case a != b { 27 21 True -> Nil ··· 29 23 panic as string.concat([ 30 24 "\n", 31 25 string.inspect(a), 32 - "\nshould not equal \n", 26 + "\nshould not equal\n", 33 27 string.inspect(b), 34 28 ]) 35 29 } 36 30 } 37 31 38 - @external(erlang, "gleeunit_ffi", "should_be_ok") 39 32 pub fn be_ok(a: Result(a, e)) -> a { 40 33 case a { 41 34 Ok(value) -> value ··· 43 36 } 44 37 } 45 38 46 - @external(erlang, "gleeunit_ffi", "should_be_error") 47 39 pub fn be_error(a: Result(a, e)) -> e { 48 40 case a { 49 41 Error(error) -> error
+1
testhelper/gleam.toml
··· 1 1 name = "testhelper" 2 2 version = "1.0.0" 3 + dependencies = { gleam_stdlib = ">= 0.60.0 and < 1.0.0" }
+1 -3
testhelper/manifest.toml
··· 3 3 4 4 packages = [ 5 5 { name = "gleam_stdlib", version = "0.60.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "621D600BB134BC239CB2537630899817B1A42E60A1D46C5E9F3FAE39F88C800B" }, 6 - { name = "gleeunit", version = "1.3.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "A7DD6C07B7DA49A6E28796058AA89E651D233B357D5607006D70619CD89DAAAB" }, 7 6 ] 8 7 9 8 [requirements] 10 - gleam_stdlib = { version = ">= 0.44.0 and < 2.0.0" } 11 - gleeunit = { version = ">= 1.0.0 and < 2.0.0" } 9 + gleam_stdlib = { version = ">= 0.60.0 and < 1.0.0" }