this repo has no description
0
fork

Configure Feed

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

v1.0.1

+24 -39
+4
CHANGELOG.md
··· 1 1 # Changelog 2 2 3 + ## v1.0.1 - 2023-12-19 4 + 5 + - Updated for Gleam v0.33.0. 6 + 3 7 ## v1.0.0 - 2023-08-06 4 8 5 9 - Updated for Gleam v0.32.0.
+1 -1
gleam.toml
··· 1 1 name = "gleeunit" 2 - version = "1.0.0" 2 + version = "1.0.1" 3 3 licences = ["Apache-2.0"] 4 4 description = "Gleam bindings to Erlang's EUnit test framework" 5 5 gleam = ">= 0.32.0"
+1 -1
manifest.toml
··· 2 2 # You typically do not need to edit this file 3 3 4 4 packages = [ 5 - { name = "gleam_stdlib", version = "0.32.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "07D64C26D014CF570F8ACADCE602761EA2E74C842D26F2FD49B0D61973D9966F" }, 5 + { name = "gleam_stdlib", version = "0.34.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "1FB8454D2991E9B4C0C804544D8A9AD0F6184725E20D63C3155F0AEB4230B016" }, 6 6 ] 7 7 8 8 [requirements]
+18 -37
src/gleeunit/should.gleam
··· 4 4 //// More information on running eunit can be found in [the rebar3 5 5 //// documentation](https://rebar3.org/docs/testing/eunit/). 6 6 7 - @target(erlang) 8 - @external(erlang, "gleeunit_ffi", "should_equal") 9 - pub fn equal(a: a, b: a) -> Nil 10 7 11 - @target(erlang) 12 - @external(erlang, "gleeunit_ffi", "should_not_equal") 13 - pub fn not_equal(a: a, b: a) -> Nil 14 8 15 - @target(erlang) 16 - @external(erlang, "gleeunit_ffi", "should_be_ok") 17 - pub fn be_ok(a: Result(a, b)) -> a 18 9 19 - @target(erlang) 20 - @external(erlang, "gleeunit_ffi", "should_be_error") 21 - pub fn be_error(a: Result(a, b)) -> b 22 10 23 - @target(javascript) 24 11 import gleam/string 25 12 26 - @target(javascript) 27 - @external(javascript, "../gleam.mjs", "inspect") 28 - fn stringify(a: anything) -> String 29 13 30 - @target(javascript) 31 - @external(javascript, "../gleeunit_ffi.mjs", "crash") 32 - fn crash(a: String) -> anything 33 14 34 - @target(javascript) 35 - pub fn equal(a, b) { 15 + @external(erlang, "gleeunit_ffi", "should_equal") 16 + pub fn equal(a: t, b: t) -> Nil { 36 17 case a == b { 37 18 True -> Nil 38 19 _ -> 39 - crash(string.concat([ 20 + panic as string.concat([ 40 21 "\n\t", 41 - stringify(a), 22 + string.inspect(a), 42 23 "\n\tshould equal \n\t", 43 - stringify(b), 44 - ])) 24 + string.inspect(b), 25 + ]) 45 26 } 46 27 } 47 28 48 - @target(javascript) 49 - pub fn not_equal(a, b) { 29 + @external(erlang, "gleeunit_ffi", "should_not_equal") 30 + pub fn not_equal(a: t, b: t) -> Nil { 50 31 case a != b { 51 32 True -> Nil 52 33 _ -> 53 - crash(string.concat([ 34 + panic as string.concat([ 54 35 "\n", 55 - stringify(a), 36 + string.inspect(a), 56 37 "\nshould not equal \n", 57 - stringify(b), 58 - ])) 38 + string.inspect(b), 39 + ]) 59 40 } 60 41 } 61 42 62 - @target(javascript) 63 - pub fn be_ok(a) { 43 + @external(erlang, "gleeunit_ffi", "should_be_ok") 44 + pub fn be_ok(a: Result(a, e)) -> a { 64 45 case a { 65 46 Ok(value) -> value 66 - _ -> crash(string.concat(["\n", stringify(a), "\nshould be ok"])) 47 + _ -> panic as string.concat(["\n", string.inspect(a), "\nshould be ok"]) 67 48 } 68 49 } 69 50 70 - @target(javascript) 71 - pub fn be_error(a) { 51 + @external(erlang, "gleeunit_ffi", "should_be_error") 52 + pub fn be_error(a: Result(a, e)) -> e { 72 53 case a { 73 54 Error(error) -> error 74 - _ -> crash(string.concat(["\n", stringify(a), "\nshould be error"])) 55 + _ -> panic as string.concat(["\n", string.inspect(a), "\nshould be error"]) 75 56 } 76 57 } 77 58