Skip to content

Commit

Permalink
prepare release v2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrange committed Mar 3, 2023
1 parent 0f97767 commit 070746c
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bash_unit
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#
# https://github.com/pgrange/bash_unit

VERSION=v2.0.1
VERSION=v2.1.0

ESCAPE=$(printf "\033")
NOCOLOR="${ESCAPE}[0m"
Expand Down
53 changes: 50 additions & 3 deletions docs/man/man1/bash_unit.1
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'\" t
.\" Title: bash_unit
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.17
.\" Date: 2022-09-28
.\" Generator: Asciidoctor 2.0.18
.\" Date: 2023-03-03
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "BASH_UNIT" "1" "2022-09-28" "\ \&" "\ \&"
.TH "BASH_UNIT" "1" "2023-03-03" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
Expand Down Expand Up @@ -102,6 +102,8 @@ Running tests in tests/test_core.sh
Running test_assert_status_code_fails ... SUCCESS
Running test_assert_status_code_succeeds ... SUCCESS
Running test_assert_succeeds ... SUCCESS
Running test_assert_within_delta_fails ... SUCCESS
Running test_assert_within_delta_succeeds ... SUCCESS
Running test_fail_fails ... SUCCESS
Running test_fail_prints_failure_message ... SUCCESS
Running test_fail_prints_where_is_error ... SUCCESS
Expand Down Expand Up @@ -151,6 +153,8 @@ Running tests in tests/test_core.sh
Running test_assert_status_code_fails ... SUCCESS
Running test_assert_status_code_succeeds ... SUCCESS
Running test_assert_succeeds ... SUCCESS
Running test_assert_within_delta_fails ... SUCCESS
Running test_assert_within_delta_succeeds ... SUCCESS
Running test_fail_fails ... SUCCESS
Overall result: SUCCESS
.fam
Expand Down Expand Up @@ -192,6 +196,8 @@ ok \- test_assert_shows_stdout_on_failure
ok \- test_assert_status_code_fails
ok \- test_assert_status_code_succeeds
ok \- test_assert_succeeds
ok \- test_assert_within_delta_fails
ok \- test_assert_within_delta_succeeds
ok \- test_fail_fails
ok \- test_fail_prints_failure_message
ok \- test_fail_prints_where_is_error
Expand Down Expand Up @@ -604,6 +610,47 @@ doc:2:test_obvious_matching_with_assert_not_matches()
.fam
.fi
.if n .RE
.SS "\fBassert_within_delta\fP"
.sp
.if n .RS 4
.nf
.fam C
assert_within_delta <expected num> <actual num> <max delta> [message]
.fam
.fi
.if n .RE
.sp
Asserts that the expected num matches the actual num up to a given max delta.
This function only support integers.
Given an expectation of 5 and a delta of 2 this would match 3, 4, 5, 6, and 7:
.sp
.if n .RS 4
.nf
.fam C
test_matches_within_delta(){
assert_within_delta 5 3 2
assert_within_delta 5 4 2
assert_within_delta 5 5 2
assert_within_delta 5 6 2
assert_within_delta 5 7 2
}
test_does_not_match_within_delta(){
assert_within_delta 5 2 2
}
.fam
.fi
.if n .RE
.sp
.if n .RS 4
.nf
.fam C
Running test_does_not_match_within_delta ... FAILURE
expected value [5] to match [2] with a maximum delta of [2]
doc:9:test_does_not_match_within_delta()
Running test_matches_within_delta ... SUCCESS
.fam
.fi
.if n .RE
.SS "\fBassert_no_diff\fP"
.sp
.if n .RS 4
Expand Down

0 comments on commit 070746c

Please sign in to comment.