Packages

A library for programatically building and running test cases

Current section

6 Versions

Jump to

Compare versions

5 files changed
+19 additions
-9 deletions
  @@ -1,5 +1,5 @@
1 1 name = "testbldr"
2 - version = "0.1.0"
2 + version = "0.1.1"
3 3 description = "A Gleam project"
4 4
5 5 # Fill out these fields if you intend to generate HTML documentation or publish
  @@ -1,6 +1,6 @@
1 1 {<<"name">>, <<"testbldr">>}.
2 2 {<<"app">>, <<"testbldr">>}.
3 - {<<"version">>, <<"0.1.0">>}.
3 + {<<"version">>, <<"0.1.1">>}.
4 4 {<<"description">>, <<"A Gleam project">>}.
5 5 {<<"licenses">>, [<<"Apache-2.0">>]}.
6 6 {<<"build_tools">>, [<<"gleam">>]}.
  @@ -8,6 +8,11 @@
8 8 {<<"Repository">>, <<"https://github.com/bcpeinhardt/testbldr">>}
9 9 ]}.
10 10 {<<"requirements">>, [
11 + {<<"simplifile">>, [
12 + {<<"app">>, <<"simplifile">>},
13 + {<<"optional">>, false},
14 + {<<"requirement">>, <<"~> 0.1">>}
15 + ]},
11 16 {<<"gleam_otp">>, [
12 17 {<<"app">>, <<"gleam_otp">>},
13 18 {<<"optional">>, false},
  @@ -18,11 +23,6 @@
18 23 {<<"optional">>, false},
19 24 {<<"requirement">>, <<"~> 0.2">>}
20 25 ]},
21 - {<<"simplifile">>, [
22 - {<<"app">>, <<"simplifile">>},
23 - {<<"optional">>, false},
24 - {<<"requirement">>, <<"~> 0.1">>}
25 - ]},
26 26 {<<"glance">>, [
27 27 {<<"app">>, <<"glance">>},
28 28 {<<"optional">>, false},
  @@ -1,5 +1,5 @@
1 1 {application, testbldr, [
2 - {vsn, "0.1.0"},
2 + {vsn, "0.1.1"},
3 3 {applications, [colours,
4 4 glance,
5 5 gleam_otp,
  @@ -1,7 +1,7 @@
1 1 -module(testbldr).
2 2 -compile([no_auto_import, nowarn_unused_vars]).
3 3
4 - -export([pass/0, fail/1, test/3, tests/2, run/1]).
4 + -export([pass/0, fail/1, named/2, test/3, tests/2, run/1]).
5 5 -export_type([test_outcome/0]).
6 6
7 7 -type test_outcome() :: pass | {fail, binary()}.
  @@ -14,6 +14,11 @@ pass() ->
14 14 fail(Msg) ->
15 15 {fail, Msg}.
16 16
17 + -spec named(binary(), fun(() -> test_outcome())) -> {binary(),
18 + fun(() -> test_outcome())}.
19 + named(Name, New_test) ->
20 + {Name, New_test}.
21 +
17 22 -spec test(
18 23 list({binary(), fun(() -> test_outcome())}),
19 24 binary(),
  @@ -26,6 +26,11 @@ pub fn fail(msg: String) -> TestOutcome {
26 26 Fail(msg)
27 27 }
28 28
29 + /// Creates a new test with the given name
30 + pub fn named(name: String, new_test: fn() -> TestOutcome) -> Test {
31 + #(name, new_test)
32 + }
33 +
29 34 /// The list of tests to run
30 35 pub type TestSuite =
31 36 List(Test)