### Add Gleeunit Dev Dependency Source: https://hexdocs.pm/gleeunit/index.html Install Gleeunit as a development dependency for your Gleam project using the gleam add command. ```bash gleam add gleeunit@1 --dev ``` -------------------------------- ### Configure Gleeunit Main Function Source: https://hexdocs.pm/gleeunit/index.html Set up the main function in your test file to enable Gleeunit to discover and run tests. Ensure the file is located in the test directory. ```gleam import gleeunit pub fn main() { gleeunit.main() } ``` -------------------------------- ### Configure Deno JavaScript Runtime Source: https://hexdocs.pm/gleeunit/index.html If you are using the Deno JavaScript runtime, add the specified configuration to your `gleam.toml` file to allow read access to necessary directories for testing. ```toml [javascript.deno] allow_read = [ "gleam.toml", "test", "build", ] ``` -------------------------------- ### be_none Source: https://hexdocs.pm/gleeunit/gleeunit/should.html Asserts that an Option is None. ```APIDOC ## be_none ### Description Asserts that an Option is None. ### Signature ``` pub fn be_none(a: option.Option(a)) -> Nil ``` ``` -------------------------------- ### Assert Equality Source: https://hexdocs.pm/gleeunit/gleeunit/should.html Use `equal` to assert that two values are equal. This function does not return any value upon success. ```gleeunit pub fn equal(a: t, b: t) -> Nil ``` -------------------------------- ### equal Source: https://hexdocs.pm/gleeunit/gleeunit/should.html Asserts that two values are equal. ```APIDOC ## equal ### Description Asserts that two values are equal. ### Signature ``` pub fn equal(a: t, b: t) -> Nil ``` ``` -------------------------------- ### Gleeunit Main Function Source: https://hexdocs.pm/gleeunit/gleeunit.html The main function for Gleeunit, which returns `Nil`. ```gleam pub fn main() -> Nil ``` -------------------------------- ### Assert Inequality Source: https://hexdocs.pm/gleeunit/gleeunit/should.html Use `not_equal` to assert that two values are not equal. This function does not return any value upon success. ```gleeunit pub fn not_equal(a: t, b: t) -> Nil ``` -------------------------------- ### Check if an Option is None Source: https://hexdocs.pm/gleeunit/gleeunit/should.html Use `be_none` to assert that an `Option` type is `None`. This function does not return any value upon success. ```gleeunit pub fn be_none(a: option.Option(a)) -> Nil ``` -------------------------------- ### be_some Source: https://hexdocs.pm/gleeunit/gleeunit/should.html Asserts that an Option is Some. Returns the Some value if the assertion passes. ```APIDOC ## be_some ### Description Asserts that an Option is Some. Returns the Some value if the assertion passes. ### Signature ``` pub fn be_some(a: option.Option(a)) -> a ``` ``` -------------------------------- ### be_ok Source: https://hexdocs.pm/gleeunit/gleeunit/should.html Asserts that a Result is Ok. Returns the Ok value if the assertion passes. ```APIDOC ## be_ok ### Description Asserts that a Result is Ok. Returns the Ok value if the assertion passes. ### Signature ``` pub fn be_ok(a: Result(a, e)) -> a ``` ``` -------------------------------- ### Check if a Result is Ok Source: https://hexdocs.pm/gleeunit/gleeunit/should.html Use `be_ok` to assert that a `Result` type contains an Ok value. It returns the Ok value if the assertion passes. ```gleeunit pub fn be_ok(a: Result(a, e)) -> a ``` -------------------------------- ### be_true Source: https://hexdocs.pm/gleeunit/gleeunit/should.html Asserts that a boolean value is true. ```APIDOC ## be_true ### Description Asserts that a boolean value is true. ### Signature ``` pub fn be_true(actual: Bool) -> Nil ``` ``` -------------------------------- ### not_equal Source: https://hexdocs.pm/gleeunit/gleeunit/should.html Asserts that two values are not equal. ```APIDOC ## not_equal ### Description Asserts that two values are not equal. ### Signature ``` pub fn not_equal(a: t, b: t) -> Nil ``` ``` -------------------------------- ### Define a Gleeunit Test Function Source: https://hexdocs.pm/gleeunit/index.html Write test functions in your Gleam project by defining public functions whose names end with `_test`. These functions will be automatically discovered and executed by Gleeunit. ```gleam pub fn some_function_test() { assert some_function() == "Hello!" } ``` -------------------------------- ### be_false Source: https://hexdocs.pm/gleeunit/gleeunit/should.html Asserts that a boolean value is false. ```APIDOC ## be_false ### Description Asserts that a boolean value is false. ### Signature ``` pub fn be_false(actual: Bool) -> Nil ``` ``` -------------------------------- ### Force a Test Failure Source: https://hexdocs.pm/gleeunit/gleeunit/should.html Use `fail` to unconditionally cause a test to fail. This function does not return any value. ```gleeunit pub fn fail() -> Nil ``` -------------------------------- ### Check if an Option is Some Source: https://hexdocs.pm/gleeunit/gleeunit/should.html Use `be_some` to assert that an `Option` type contains a `Some` value. It returns the contained value if the assertion passes. ```gleeunit pub fn be_some(a: option.Option(a)) -> a ``` -------------------------------- ### Check if a Boolean is False Source: https://hexdocs.pm/gleeunit/gleeunit/should.html Use `be_false` to assert that a boolean value is false. This function does not return any value upon success. ```gleeunit pub fn be_false(actual: Bool) -> Nil ``` -------------------------------- ### Check if a Boolean is True Source: https://hexdocs.pm/gleeunit/gleeunit/should.html Use `be_true` to assert that a boolean value is true. This function does not return any value upon success. ```gleeunit pub fn be_true(actual: Bool) -> Nil ``` -------------------------------- ### fail Source: https://hexdocs.pm/gleeunit/gleeunit/should.html Causes the test to fail unconditionally. ```APIDOC ## fail ### Description Causes the test to fail unconditionally. ### Signature ``` pub fn fail() -> Nil ``` ``` -------------------------------- ### Check if a Result is an Error Source: https://hexdocs.pm/gleeunit/gleeunit/should.html Use `be_error` to assert that a `Result` type contains an error. It returns the error value if the assertion passes. ```gleeunit pub fn be_error(a: Result(a, e)) -> e ``` -------------------------------- ### be_error Source: https://hexdocs.pm/gleeunit/gleeunit/should.html Asserts that a Result is an error. Returns the error value if the assertion passes. ```APIDOC ## be_error ### Description Asserts that a Result is an error. Returns the error value if the assertion passes. ### Signature ``` pub fn be_error(a: Result(a, e)) -> e ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.