Skip to content

Commit 739bde6

Browse files
author
Pascal Grange
committed
prepare release v1.9.0
1 parent 2ebb920 commit 739bde6

File tree

2 files changed

+92
-4
lines changed

2 files changed

+92
-4
lines changed

bash_unit

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717
# https://github.com/pgrange/bash_unit
1818

19-
VERSION=v1.8.0
19+
VERSION=v1.9.0
2020

2121
ESCAPE=$(printf "\033")
2222
NOCOLOR="${ESCAPE}[0m"

docs/man/man1/bash_unit.1

+91-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
.\" Title: bash_unit
33
.\" Author: [see the "AUTHOR(S)" section]
44
.\" Generator: Asciidoctor 2.0.16
5-
.\" Date: 2021-11-07
5+
.\" Date: 2022-01-01
66
.\" Manual: \ \&
77
.\" Source: \ \&
88
.\" Language: English
99
.\"
10-
.TH "BASH_UNIT" "1" "2021-11-07" "\ \&" "\ \&"
10+
.TH "BASH_UNIT" "1" "2022-01-01" "\ \&" "\ \&"
1111
.ie \n(.g .ds Aq \(aq
1212
.el .ds Aq '
1313
.ss \n[.ss] 0
@@ -89,10 +89,14 @@ Running tests in tests/test_core.sh
8989
Running test_assert_fails ... SUCCESS
9090
Running test_assert_fails_fails ... SUCCESS
9191
Running test_assert_fails_succeeds ... SUCCESS
92+
Running test_assert_matches_fails_when_not_matching ... SUCCESS
93+
Running test_assert_matches_succeed_when_matching ... SUCCESS
9294
Running test_assert_no_diff_fails_when_diff ... SUCCESS
9395
Running test_assert_no_diff_succeeds_when_no_diff ... SUCCESS
9496
Running test_assert_not_equals_fails_when_equal ... SUCCESS
9597
Running test_assert_not_equals_succeeds_when_not_equal ... SUCCESS
98+
Running test_assert_not_matches_fails_when_matching ... SUCCESS
99+
Running test_assert_not_matches_succeed_when_not_matching ... SUCCESS
96100
Running test_assert_shows_stderr_on_failure ... SUCCESS
97101
Running test_assert_shows_stdout_on_failure ... SUCCESS
98102
Running test_assert_status_code_fails ... SUCCESS
@@ -133,10 +137,14 @@ Running tests in tests/test_core.sh
133137
Running test_assert_fails ... SUCCESS
134138
Running test_assert_fails_fails ... SUCCESS
135139
Running test_assert_fails_succeeds ... SUCCESS
140+
Running test_assert_matches_fails_when_not_matching ... SUCCESS
141+
Running test_assert_matches_succeed_when_matching ... SUCCESS
136142
Running test_assert_no_diff_fails_when_diff ... SUCCESS
137143
Running test_assert_no_diff_succeeds_when_no_diff ... SUCCESS
138144
Running test_assert_not_equals_fails_when_equal ... SUCCESS
139145
Running test_assert_not_equals_succeeds_when_not_equal ... SUCCESS
146+
Running test_assert_not_matches_fails_when_matching ... SUCCESS
147+
Running test_assert_not_matches_succeed_when_not_matching ... SUCCESS
140148
Running test_assert_shows_stderr_on_failure ... SUCCESS
141149
Running test_assert_shows_stdout_on_failure ... SUCCESS
142150
Running test_assert_status_code_fails ... SUCCESS
@@ -170,10 +178,14 @@ ok \- test_assert_equals_succeed_when_equal
170178
ok \- test_assert_fails
171179
ok \- test_assert_fails_fails
172180
ok \- test_assert_fails_succeeds
181+
ok \- test_assert_matches_fails_when_not_matching
182+
ok \- test_assert_matches_succeed_when_matching
173183
ok \- test_assert_no_diff_fails_when_diff
174184
ok \- test_assert_no_diff_succeeds_when_no_diff
175185
ok \- test_assert_not_equals_fails_when_equal
176186
ok \- test_assert_not_equals_succeeds_when_not_equal
187+
ok \- test_assert_not_matches_fails_when_matching
188+
ok \- test_assert_not_matches_succeed_when_not_matching
177189
ok \- test_assert_shows_stderr_on_failure
178190
ok \- test_assert_shows_stdout_on_failure
179191
ok \- test_assert_status_code_fails
@@ -518,7 +530,83 @@ doc:2:test_obvious_equality_with_assert_not_equals()
518530
.fam
519531
.fi
520532
.if n .RE
521-
.SH "\fBFAKE\fP FUNCTION"
533+
.sp
534+
####
535+
=== \fBassert_matches\fP
536+
.sp
537+
.if n .RS 4
538+
.nf
539+
.fam C
540+
assert_matches <expected\-regex> <actual> [message]
541+
.fam
542+
.fi
543+
.if n .RE
544+
.sp
545+
Asserts that the string \fIactual\fP matches the regex pattern \fIexpected\-regex\fP.
546+
.sp
547+
.if n .RS 4
548+
.nf
549+
.fam C
550+
test_obvious_notmatching_with_assert_matches(){
551+
assert_matches "a str.*" "another string" "\*(Aqanother string\*(Aq should not match \*(Aqa str.*\*(Aq"
552+
}
553+
test_obvious_matching_with_assert_matches(){
554+
assert_matches "a[nN].t{0,1}.*r str.*" "another string"
555+
}
556+
.fam
557+
.fi
558+
.if n .RE
559+
.sp
560+
.if n .RS 4
561+
.nf
562+
.fam C
563+
Running test_obvious_matching_with_assert_matches ... SUCCESS
564+
Running test_obvious_notmatching_with_assert_matches ... FAILURE
565+
\*(Aqanother string\*(Aq should not match \*(Aqa str.*\*(Aq
566+
expected regex [a str.*] to match [another string]
567+
doc:2:test_obvious_notmatching_with_assert_matches()
568+
.fam
569+
.fi
570+
.if n .RE
571+
.SS "\fBassert_not_matches\fP"
572+
.sp
573+
.if n .RS 4
574+
.nf
575+
.fam C
576+
assert_not_matches <unexpected\-regex> <actual> [message]
577+
.fam
578+
.fi
579+
.if n .RE
580+
.sp
581+
Asserts that the string \fIactual\fP does not match the regex pattern \fIunexpected\-regex\fP.
582+
.sp
583+
.if n .RS 4
584+
.nf
585+
.fam C
586+
test_obvious_matching_with_assert_not_matches(){
587+
assert_not_matches "a str.*" "a string" "\*(Aqa string\*(Aq should not match \*(Aqa str.*\*(Aq"
588+
}
589+
test_obvious_notmatching_with_assert_not_matches(){
590+
assert_not_matches "a str.*" "another string"
591+
}
592+
.fam
593+
.fi
594+
.if n .RE
595+
.sp
596+
.if n .RS 4
597+
.nf
598+
.fam C
599+
Running test_obvious_matching_with_assert_not_matches ... FAILURE
600+
\*(Aqa string\*(Aq should not match \*(Aqa str.*\*(Aq
601+
expected regex [a str.*] should not match but matched [a string]
602+
doc:2:test_obvious_matching_with_assert_not_matches()
603+
Running test_obvious_notmatching_with_assert_not_matches ... SUCCESS
604+
.fam
605+
.fi
606+
.if n .RE
607+
.sp
608+
####
609+
== \fBfake\fP function
522610
.sp
523611
.if n .RS 4
524612
.nf

0 commit comments

Comments
 (0)