Skip to content

Commit

Permalink
prepare release v1.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Grange committed Jan 1, 2022
1 parent 2ebb920 commit 739bde6
Show file tree
Hide file tree
Showing 2 changed files with 92 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=v1.8.0
VERSION=v1.9.0

ESCAPE=$(printf "\033")
NOCOLOR="${ESCAPE}[0m"
Expand Down
94 changes: 91 additions & 3 deletions docs/man/man1/bash_unit.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
.\" Title: bash_unit
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.16
.\" Date: 2021-11-07
.\" Date: 2022-01-01
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "BASH_UNIT" "1" "2021-11-07" "\ \&" "\ \&"
.TH "BASH_UNIT" "1" "2022-01-01" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
Expand Down Expand Up @@ -89,10 +89,14 @@ Running tests in tests/test_core.sh
Running test_assert_fails ... SUCCESS
Running test_assert_fails_fails ... SUCCESS
Running test_assert_fails_succeeds ... SUCCESS
Running test_assert_matches_fails_when_not_matching ... SUCCESS
Running test_assert_matches_succeed_when_matching ... SUCCESS
Running test_assert_no_diff_fails_when_diff ... SUCCESS
Running test_assert_no_diff_succeeds_when_no_diff ... SUCCESS
Running test_assert_not_equals_fails_when_equal ... SUCCESS
Running test_assert_not_equals_succeeds_when_not_equal ... SUCCESS
Running test_assert_not_matches_fails_when_matching ... SUCCESS
Running test_assert_not_matches_succeed_when_not_matching ... SUCCESS
Running test_assert_shows_stderr_on_failure ... SUCCESS
Running test_assert_shows_stdout_on_failure ... SUCCESS
Running test_assert_status_code_fails ... SUCCESS
Expand Down Expand Up @@ -133,10 +137,14 @@ Running tests in tests/test_core.sh
Running test_assert_fails ... SUCCESS
Running test_assert_fails_fails ... SUCCESS
Running test_assert_fails_succeeds ... SUCCESS
Running test_assert_matches_fails_when_not_matching ... SUCCESS
Running test_assert_matches_succeed_when_matching ... SUCCESS
Running test_assert_no_diff_fails_when_diff ... SUCCESS
Running test_assert_no_diff_succeeds_when_no_diff ... SUCCESS
Running test_assert_not_equals_fails_when_equal ... SUCCESS
Running test_assert_not_equals_succeeds_when_not_equal ... SUCCESS
Running test_assert_not_matches_fails_when_matching ... SUCCESS
Running test_assert_not_matches_succeed_when_not_matching ... SUCCESS
Running test_assert_shows_stderr_on_failure ... SUCCESS
Running test_assert_shows_stdout_on_failure ... SUCCESS
Running test_assert_status_code_fails ... SUCCESS
Expand Down Expand Up @@ -170,10 +178,14 @@ ok \- test_assert_equals_succeed_when_equal
ok \- test_assert_fails
ok \- test_assert_fails_fails
ok \- test_assert_fails_succeeds
ok \- test_assert_matches_fails_when_not_matching
ok \- test_assert_matches_succeed_when_matching
ok \- test_assert_no_diff_fails_when_diff
ok \- test_assert_no_diff_succeeds_when_no_diff
ok \- test_assert_not_equals_fails_when_equal
ok \- test_assert_not_equals_succeeds_when_not_equal
ok \- test_assert_not_matches_fails_when_matching
ok \- test_assert_not_matches_succeed_when_not_matching
ok \- test_assert_shows_stderr_on_failure
ok \- test_assert_shows_stdout_on_failure
ok \- test_assert_status_code_fails
Expand Down Expand Up @@ -518,7 +530,83 @@ doc:2:test_obvious_equality_with_assert_not_equals()
.fam
.fi
.if n .RE
.SH "\fBFAKE\fP FUNCTION"
.sp
####
=== \fBassert_matches\fP
.sp
.if n .RS 4
.nf
.fam C
assert_matches <expected\-regex> <actual> [message]
.fam
.fi
.if n .RE
.sp
Asserts that the string \fIactual\fP matches the regex pattern \fIexpected\-regex\fP.
.sp
.if n .RS 4
.nf
.fam C
test_obvious_notmatching_with_assert_matches(){
assert_matches "a str.*" "another string" "\*(Aqanother string\*(Aq should not match \*(Aqa str.*\*(Aq"
}
test_obvious_matching_with_assert_matches(){
assert_matches "a[nN].t{0,1}.*r str.*" "another string"
}
.fam
.fi
.if n .RE
.sp
.if n .RS 4
.nf
.fam C
Running test_obvious_matching_with_assert_matches ... SUCCESS
Running test_obvious_notmatching_with_assert_matches ... FAILURE
\*(Aqanother string\*(Aq should not match \*(Aqa str.*\*(Aq
expected regex [a str.*] to match [another string]
doc:2:test_obvious_notmatching_with_assert_matches()
.fam
.fi
.if n .RE
.SS "\fBassert_not_matches\fP"
.sp
.if n .RS 4
.nf
.fam C
assert_not_matches <unexpected\-regex> <actual> [message]
.fam
.fi
.if n .RE
.sp
Asserts that the string \fIactual\fP does not match the regex pattern \fIunexpected\-regex\fP.
.sp
.if n .RS 4
.nf
.fam C
test_obvious_matching_with_assert_not_matches(){
assert_not_matches "a str.*" "a string" "\*(Aqa string\*(Aq should not match \*(Aqa str.*\*(Aq"
}
test_obvious_notmatching_with_assert_not_matches(){
assert_not_matches "a str.*" "another string"
}
.fam
.fi
.if n .RE
.sp
.if n .RS 4
.nf
.fam C
Running test_obvious_matching_with_assert_not_matches ... FAILURE
\*(Aqa string\*(Aq should not match \*(Aqa str.*\*(Aq
expected regex [a str.*] should not match but matched [a string]
doc:2:test_obvious_matching_with_assert_not_matches()
Running test_obvious_notmatching_with_assert_not_matches ... SUCCESS
.fam
.fi
.if n .RE
.sp
####
== \fBfake\fP function
.sp
.if n .RS 4
.nf
Expand Down

0 comments on commit 739bde6

Please sign in to comment.