eac_git 0.18.1 → 0.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/eac_git/local/remote.rb +0 -2
- data/lib/eac_git/local/subrepo/config.rb +2 -0
- data/lib/eac_git/remote_like/ls_result.rb +1 -1
- data/lib/eac_git/remote_like.rb +0 -1
- data/lib/eac_git/rspec/stubbed_git_local_repo.rb +0 -2
- data/lib/eac_git/rspec.rb +0 -1
- data/lib/eac_git/version.rb +1 -1
- data/lib/eac_git.rb +0 -2
- data/vendor/git-subrepo/.fish.rc +20 -0
- data/vendor/git-subrepo/.gitattributes +1 -0
- data/vendor/git-subrepo/.github/workflows/test.yml +29 -0
- data/vendor/git-subrepo/.gitignore +1 -0
- data/vendor/git-subrepo/.gitrepo +7 -0
- data/vendor/git-subrepo/.rc +32 -0
- data/vendor/git-subrepo/Changes +66 -0
- data/vendor/git-subrepo/Intro.pod +2 -5
- data/vendor/git-subrepo/Makefile +45 -5
- data/vendor/git-subrepo/Meta +2 -2
- data/vendor/git-subrepo/ReadMe.pod +26 -31
- data/vendor/git-subrepo/doc/git-subrepo.swim +22 -18
- data/vendor/git-subrepo/doc/intro-to-subrepo.swim +2 -4
- data/vendor/git-subrepo/ext/bashplus/.gitrepo +12 -0
- data/vendor/git-subrepo/ext/bashplus/.travis.yml +6 -0
- data/vendor/git-subrepo/ext/bashplus/Changes +19 -0
- data/vendor/git-subrepo/ext/bashplus/License +1 -1
- data/vendor/git-subrepo/ext/bashplus/Makefile +25 -0
- data/vendor/git-subrepo/ext/bashplus/Meta +4 -4
- data/vendor/git-subrepo/ext/bashplus/ReadMe.pod +2 -2
- data/vendor/git-subrepo/ext/bashplus/bin/bash+ +8 -7
- data/vendor/git-subrepo/ext/bashplus/doc/bash+.swim +1 -1
- data/vendor/git-subrepo/ext/bashplus/lib/bash+.bash +85 -38
- data/vendor/git-subrepo/ext/bashplus/man/man1/bash+.1 +8 -8
- data/vendor/git-subrepo/ext/bashplus/man/man3/bash+.3 +8 -8
- data/vendor/git-subrepo/ext/bashplus/test/base.t +4 -5
- data/vendor/git-subrepo/ext/bashplus/test/die.t +16 -0
- data/vendor/git-subrepo/ext/bashplus/test/fcopy.t +2 -3
- data/vendor/git-subrepo/ext/bashplus/test/{test.bash → setup} +18 -8
- data/vendor/git-subrepo/ext/bashplus/test/shellcheck.t +37 -0
- data/vendor/git-subrepo/ext/bashplus/test/source-bash+-std.t +10 -11
- data/vendor/git-subrepo/ext/bashplus/test/source-bash+.t +10 -11
- data/vendor/git-subrepo/ext/bashplus/test/use.t +8 -5
- data/vendor/git-subrepo/ext/bashplus/test/version-check.t +23 -0
- data/vendor/git-subrepo/ext/test-more-bash/.gitrepo +12 -0
- data/vendor/git-subrepo/ext/test-more-bash/.travis.yml +6 -0
- data/vendor/git-subrepo/ext/test-more-bash/Changes +11 -0
- data/vendor/git-subrepo/ext/test-more-bash/License +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/Makefile +25 -0
- data/vendor/git-subrepo/ext/test-more-bash/Meta +5 -5
- data/vendor/git-subrepo/ext/test-more-bash/ReadMe.pod +9 -3
- data/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim +7 -2
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/.gitrepo +12 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/.travis.yml +6 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Changes +11 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/License +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Makefile +25 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Meta +3 -3
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/ReadMe.pod +2 -2
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/bin/bash+ +8 -7
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/doc/bash+.swim +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/lib/bash+.bash +85 -38
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/man/man1/bash+.1 +8 -8
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/man/man3/bash+.3 +8 -8
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/base.t +4 -4
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/die.t +17 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/fcopy.t +2 -2
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/{test.bash → setup} +17 -8
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/shellcheck.t +38 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/source-bash+-std.t +10 -10
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/source-bash+.t +10 -10
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/use.t +8 -4
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/.gitrepo +12 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/.travis.yml +5 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Changes +11 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/License +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Makefile +30 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Meta +3 -3
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/ReadMe.pod +2 -2
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/doc/test-tap.swim +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/lib/test/tap.bash +46 -42
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/man/man3/test-tap.3 +8 -8
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/bail_out.t +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/fail.t +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/fail_fast.t +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/helper.bash +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/shellcheck.t +42 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/tap.t +11 -5
- data/vendor/git-subrepo/ext/test-more-bash/lib/test/more.bash +35 -15
- data/vendor/git-subrepo/ext/test-more-bash/man/man3/test-more.3 +16 -10
- data/vendor/git-subrepo/ext/test-more-bash/test/fail.t +15 -1
- data/vendor/git-subrepo/ext/test-more-bash/test/more.t +12 -4
- data/vendor/git-subrepo/ext/test-more-bash/test/setup +3 -3
- data/vendor/git-subrepo/ext/test-more-bash/test/shellcheck.t +35 -0
- data/vendor/git-subrepo/ext/test-more-bash/test/test/fail1.t +14 -1
- data/vendor/git-subrepo/lib/git-subrepo +375 -260
- data/vendor/git-subrepo/lib/git-subrepo.d/help-functions.bash +21 -22
- data/vendor/git-subrepo/man/man1/git-subrepo.1 +125 -141
- data/vendor/git-subrepo/pkg/bin/generate-completion.pl +0 -7
- data/vendor/git-subrepo/pkg/bin/generate-help-functions.pl +0 -2
- data/vendor/git-subrepo/share/completion.bash +1 -3
- data/vendor/git-subrepo/share/enable-completion.sh +3 -3
- data/vendor/git-subrepo/share/zsh-completion/_git-subrepo +2 -7
- data/vendor/git-subrepo/test/Dockerfile +112 -0
- data/vendor/git-subrepo/test/branch-all.t +6 -6
- data/vendor/git-subrepo/test/branch-rev-list-one-path.t +7 -8
- data/vendor/git-subrepo/test/branch-rev-list.t +7 -8
- data/vendor/git-subrepo/test/branch.t +9 -9
- data/vendor/git-subrepo/test/clean.t +3 -3
- data/vendor/git-subrepo/test/clone-annotated-tag.t +7 -7
- data/vendor/git-subrepo/test/clone.t +20 -25
- data/vendor/git-subrepo/test/config.t +7 -6
- data/vendor/git-subrepo/test/encode.t +17 -17
- data/vendor/git-subrepo/test/error.t +18 -18
- data/vendor/git-subrepo/test/fetch.t +4 -4
- data/vendor/git-subrepo/test/gitignore.t +8 -8
- data/vendor/git-subrepo/test/init.t +6 -7
- data/vendor/git-subrepo/test/issue29.t +3 -3
- data/vendor/git-subrepo/test/issue95.t +2 -2
- data/vendor/git-subrepo/test/issue96.t +3 -3
- data/vendor/git-subrepo/test/pull-all.t +5 -5
- data/vendor/git-subrepo/test/pull-merge.t +16 -15
- data/vendor/git-subrepo/test/pull-message.t +12 -12
- data/vendor/git-subrepo/test/pull-new-branch.t +8 -7
- data/vendor/git-subrepo/test/pull-ours.t +10 -10
- data/vendor/git-subrepo/test/pull-theirs.t +8 -8
- data/vendor/git-subrepo/test/pull-twice.t +4 -4
- data/vendor/git-subrepo/test/pull-worktree.t +5 -5
- data/vendor/git-subrepo/test/pull.t +14 -14
- data/vendor/git-subrepo/test/push-after-init.t +7 -6
- data/vendor/git-subrepo/test/push-after-push-no-changes.t +27 -0
- data/vendor/git-subrepo/test/push-force.t +7 -6
- data/vendor/git-subrepo/test/push-new-branch.t +10 -10
- data/vendor/git-subrepo/test/push-no-changes.t +3 -3
- data/vendor/git-subrepo/test/push-squash.t +7 -7
- data/vendor/git-subrepo/test/push.t +35 -34
- data/vendor/git-subrepo/test/rebase.t +63 -0
- data/vendor/git-subrepo/test/reclone.t +15 -8
- data/vendor/git-subrepo/test/setup +62 -55
- data/vendor/git-subrepo/test/shellcheck.t +37 -0
- data/vendor/git-subrepo/test/status.t +47 -27
- data/vendor/git-subrepo/test/submodule.t +4 -4
- data/vendor/git-subrepo/test/zsh.t +27 -0
- metadata +45 -19
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.\" Automatically generated by Pod::Man
|
|
1
|
+
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
|
2
2
|
.\"
|
|
3
3
|
.\" Standard preamble:
|
|
4
4
|
.\" ========================================================================
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
.ie \n(.g .ds Aq \(aq
|
|
47
47
|
.el .ds Aq '
|
|
48
48
|
.\"
|
|
49
|
-
.\" If the F register is
|
|
49
|
+
.\" If the F register is >0, we'll generate index entries on stderr for
|
|
50
50
|
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
|
|
51
51
|
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
|
52
52
|
.\" output yourself in some meaningful fashion.
|
|
@@ -56,12 +56,12 @@
|
|
|
56
56
|
..
|
|
57
57
|
.nr rF 0
|
|
58
58
|
.if \n(.g .if rF .nr rF 1
|
|
59
|
-
.if (\n(rF:(\n(.g==0)) \{
|
|
60
|
-
. if \nF \{
|
|
59
|
+
.if (\n(rF:(\n(.g==0)) \{\
|
|
60
|
+
. if \nF \{\
|
|
61
61
|
. de IX
|
|
62
62
|
. tm Index:\\$1\t\\n%\t"\\$2"
|
|
63
63
|
..
|
|
64
|
-
. if !\nF==2 \{
|
|
64
|
+
. if !\nF==2 \{\
|
|
65
65
|
. nr % 0
|
|
66
66
|
. nr F 2
|
|
67
67
|
. \}
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
.rr rF
|
|
71
71
|
.\" ========================================================================
|
|
72
72
|
.\"
|
|
73
|
-
.IX Title "
|
|
74
|
-
.TH
|
|
73
|
+
.IX Title "STDIN 1"
|
|
74
|
+
.TH STDIN 1 "November 2020" "Generated by Swim v0.1.48" "\s-1TAP\s0 Test Base for Bash"
|
|
75
75
|
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
|
76
76
|
.\" way too many mistakes in technical documents.
|
|
77
77
|
.if n .ad l
|
|
@@ -114,6 +114,6 @@ Finish this doc.
|
|
|
114
114
|
Written by Ingy döt Net <ingy@ingy.net>
|
|
115
115
|
.SH "Copyright & License"
|
|
116
116
|
.IX Header "Copyright & License"
|
|
117
|
-
Copyright 2013\-
|
|
117
|
+
Copyright 2013\-2020. Ingy döt Net.
|
|
118
118
|
.PP
|
|
119
119
|
The \s-1MIT\s0 License (\s-1MIT\s0).
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
source lib/test/tap.bash
|
|
4
|
+
|
|
5
|
+
if ! command -v shellcheck >/dev/null; then
|
|
6
|
+
Test::Tap:init skip_all "The 'shellcheck' utility is not installed"
|
|
7
|
+
fi
|
|
8
|
+
if [[ ! $(shellcheck --version) =~ 0\.7\.1 ]]; then
|
|
9
|
+
Test::Tap:init skip_all "This test wants shellcheck version 0.7.1"
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
Test::Tap:init
|
|
13
|
+
|
|
14
|
+
IFS=$'\n' read -d '' -r -a shell_files <<< "$(
|
|
15
|
+
find lib -type f
|
|
16
|
+
echo test/helper.bash
|
|
17
|
+
find test -name '*.t'
|
|
18
|
+
)" || true
|
|
19
|
+
|
|
20
|
+
skips=(
|
|
21
|
+
# We want to keep these 2 here always:
|
|
22
|
+
SC1090 # Can't follow non-constant source. Use a directive to specify location.
|
|
23
|
+
SC1091 # Not following: bash+ was not specified as input (see shellcheck -x).
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
skip=$(IFS=,; echo "${skips[*]}")
|
|
27
|
+
|
|
28
|
+
for file in "${shell_files[@]}"; do
|
|
29
|
+
[[ $file == *swp ]] && continue
|
|
30
|
+
label="The shell file '$file' passes shellcheck"
|
|
31
|
+
got=$(shellcheck -e "$skip" "$file" 2>&1) || true
|
|
32
|
+
if [[ -z $got ]]; then
|
|
33
|
+
Test::Tap:pass "$label"
|
|
34
|
+
else
|
|
35
|
+
Test::Tap:fail "$label"
|
|
36
|
+
Test::Tap:diag "$got"
|
|
37
|
+
fi
|
|
38
|
+
done
|
|
39
|
+
|
|
40
|
+
Test::Tap:done_testing
|
|
41
|
+
|
|
42
|
+
# vim: set ft=sh:
|
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
source lib/test/tap.bash
|
|
4
4
|
|
|
5
|
-
Test::Tap:init tests 4
|
|
5
|
+
Test::Tap:init tests 3 # 4
|
|
6
6
|
|
|
7
7
|
Test::Tap:pass 'pass with label'
|
|
8
8
|
Test::Tap:pass
|
|
9
9
|
Test::Tap:pass 'previous test has no label'
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
|
|
11
|
+
# TODO this test no longer working:
|
|
12
|
+
# msg=$(Test::Tap:fail 'faaaaailll' 2>/dev/null) || true
|
|
13
|
+
#
|
|
14
|
+
# if [[ $msg =~ not\ ok\ 4\ -\ faaaaailll ]]; then
|
|
15
|
+
# Test::Tap:pass 'fail works'
|
|
16
|
+
# else
|
|
17
|
+
# Test::Tap:fail 'fail works'
|
|
18
|
+
# Test::Tap:diag "$msg"
|
|
19
|
+
# fi
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
# test/more.bash - Complete TAP test framework for Bash
|
|
2
2
|
#
|
|
3
|
-
# Copyright (c) 2013-
|
|
3
|
+
# Copyright (c) 2013-2020. Ingy döt Net.
|
|
4
4
|
|
|
5
|
-
set -e
|
|
5
|
+
set -e -u -o pipefail
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
# shellcheck disable=2034
|
|
8
|
+
Test__More_VERSION=0.0.5
|
|
9
|
+
|
|
10
|
+
source bash+ :std version-check
|
|
11
|
+
|
|
12
|
+
version-check bash 3.2 ||
|
|
13
|
+
die "test-more-bash requires bash 3.2+"
|
|
8
14
|
|
|
9
|
-
source bash+ :std
|
|
10
15
|
use Test::Tap
|
|
11
16
|
|
|
12
17
|
Test::More:import() { Test::Tap:init "$@"; }
|
|
@@ -21,7 +26,7 @@ BAIL_OUT() { Test::Tap:BAIL_OUT "$@"; }
|
|
|
21
26
|
BAIL_ON_FAIL() { Test::Tap:BAIL_ON_FAIL "$@"; }
|
|
22
27
|
|
|
23
28
|
is() {
|
|
24
|
-
local got
|
|
29
|
+
local got=$1 want=$2 label=${3-}
|
|
25
30
|
if [[ $got == "$want" ]]; then
|
|
26
31
|
Test::Tap:pass "$label"
|
|
27
32
|
else
|
|
@@ -32,10 +37,10 @@ is() {
|
|
|
32
37
|
Test::More:is-fail() {
|
|
33
38
|
local Test__Tap_CALL_STACK_LEVEL=
|
|
34
39
|
Test__Tap_CALL_STACK_LEVEL=$(( Test__Tap_CALL_STACK_LEVEL + 1 ))
|
|
35
|
-
if [[
|
|
40
|
+
if [[ $want =~ $'\n' ]]; then
|
|
36
41
|
echo "$got" > /tmp/got-$$
|
|
37
42
|
echo "$want" > /tmp/want-$$
|
|
38
|
-
diff -u /tmp/{want,got}-$$ >&2
|
|
43
|
+
diff -u /tmp/{want,got}-$$ >&2 || true
|
|
39
44
|
wc /tmp/{want,got}-$$ >&2
|
|
40
45
|
rm -f /tmp/{got,want}-$$
|
|
41
46
|
else
|
|
@@ -48,7 +53,7 @@ Test::More:is-fail() {
|
|
|
48
53
|
isnt() {
|
|
49
54
|
local Test__Tap_CALL_STACK_LEVEL=
|
|
50
55
|
Test__Tap_CALL_STACK_LEVEL=$(( Test__Tap_CALL_STACK_LEVEL + 1 ))
|
|
51
|
-
local got
|
|
56
|
+
local got=$1 dontwant=$2 label=${3-}
|
|
52
57
|
if [[ $got != "$dontwant" ]]; then
|
|
53
58
|
Test::Tap:pass "$label"
|
|
54
59
|
else
|
|
@@ -63,14 +68,16 @@ Test::More:isnt-fail() {
|
|
|
63
68
|
}
|
|
64
69
|
|
|
65
70
|
ok() {
|
|
66
|
-
(exit ${1:-$?})
|
|
67
|
-
Test::Tap:pass "$2"
|
|
68
|
-
|
|
71
|
+
if (exit "${1:-$?}"); then
|
|
72
|
+
Test::Tap:pass "${2-}"
|
|
73
|
+
else
|
|
74
|
+
Test::Tap:fail "${2-}"
|
|
75
|
+
fi
|
|
69
76
|
}
|
|
70
77
|
|
|
71
78
|
like() {
|
|
72
|
-
local got=$1 regex=$2 label=$3
|
|
73
|
-
if [[ $got =~
|
|
79
|
+
local got=$1 regex=$2 label=${3-}
|
|
80
|
+
if [[ $got =~ $regex ]]; then
|
|
74
81
|
Test::Tap:pass "$label"
|
|
75
82
|
else
|
|
76
83
|
Test::Tap:fail "$label" Test::More:like-fail
|
|
@@ -82,8 +89,8 @@ Test::More:like-fail() {
|
|
|
82
89
|
}
|
|
83
90
|
|
|
84
91
|
unlike() {
|
|
85
|
-
local got=$1 regex=$2 label=$3
|
|
86
|
-
if [[ ! $got =~
|
|
92
|
+
local got=$1 regex=$2 label=${3-}
|
|
93
|
+
if [[ ! $got =~ $regex ]]; then
|
|
87
94
|
Test::Tap:pass "$label"
|
|
88
95
|
else
|
|
89
96
|
Test::Tap:fail "$label" Test::More:unlike-fail
|
|
@@ -93,3 +100,16 @@ unlike() {
|
|
|
93
100
|
Test::More:unlike-fail() {
|
|
94
101
|
Test::Tap:diag "Got: '$got'"
|
|
95
102
|
}
|
|
103
|
+
|
|
104
|
+
cmp-array() {
|
|
105
|
+
local arrayname="$1[@]"
|
|
106
|
+
local expname="$2[@]"
|
|
107
|
+
local label=${3-}
|
|
108
|
+
|
|
109
|
+
local array=("${!arrayname}")
|
|
110
|
+
local expected=("${!expname}")
|
|
111
|
+
|
|
112
|
+
is "$(printf "%s\n" "${array[@]}")" \
|
|
113
|
+
"$(printf "%s\n" "${expected[@]}")" \
|
|
114
|
+
"$label"
|
|
115
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.\" Automatically generated by Pod::Man
|
|
1
|
+
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
|
2
2
|
.\"
|
|
3
3
|
.\" Standard preamble:
|
|
4
4
|
.\" ========================================================================
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
.ie \n(.g .ds Aq \(aq
|
|
47
47
|
.el .ds Aq '
|
|
48
48
|
.\"
|
|
49
|
-
.\" If the F register is
|
|
49
|
+
.\" If the F register is >0, we'll generate index entries on stderr for
|
|
50
50
|
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
|
|
51
51
|
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
|
52
52
|
.\" output yourself in some meaningful fashion.
|
|
@@ -56,12 +56,12 @@
|
|
|
56
56
|
..
|
|
57
57
|
.nr rF 0
|
|
58
58
|
.if \n(.g .if rF .nr rF 1
|
|
59
|
-
.if (\n(rF:(\n(.g==0)) \{
|
|
60
|
-
. if \nF \{
|
|
59
|
+
.if (\n(rF:(\n(.g==0)) \{\
|
|
60
|
+
. if \nF \{\
|
|
61
61
|
. de IX
|
|
62
62
|
. tm Index:\\$1\t\\n%\t"\\$2"
|
|
63
63
|
..
|
|
64
|
-
. if !\nF==2 \{
|
|
64
|
+
. if !\nF==2 \{\
|
|
65
65
|
. nr % 0
|
|
66
66
|
. nr F 2
|
|
67
67
|
. \}
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
.rr rF
|
|
71
71
|
.\" ========================================================================
|
|
72
72
|
.\"
|
|
73
|
-
.IX Title "
|
|
74
|
-
.TH
|
|
73
|
+
.IX Title "STDIN 1"
|
|
74
|
+
.TH STDIN 1 "November 2020" "Generated by Swim v0.1.48" "\s-1TAP\s0 Testing for Bash"
|
|
75
75
|
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
|
76
76
|
.\" way too many mistakes in technical documents.
|
|
77
77
|
.if n .ad l
|
|
@@ -120,6 +120,10 @@ Write a test file like this. Maybe call it \f(CW\*(C`test/test.t\*(C'\fR:
|
|
|
120
120
|
\& diag "A message for stderr"
|
|
121
121
|
\&
|
|
122
122
|
\& note "A message for stdout"
|
|
123
|
+
\&
|
|
124
|
+
\& output=( $(ls) )
|
|
125
|
+
\& expected=(README lib bin)
|
|
126
|
+
\& cmp\-array output expected "list files"
|
|
123
127
|
.Ve
|
|
124
128
|
.PP
|
|
125
129
|
Run the test with \f(CW\*(C`prove\*(C'\fR like this:
|
|
@@ -131,7 +135,7 @@ Run the test with \f(CW\*(C`prove\*(C'\fR like this:
|
|
|
131
135
|
Prove knows it's Bash from the first line (the hashbang), and it just works.
|
|
132
136
|
.SH "Description"
|
|
133
137
|
.IX Header "Description"
|
|
134
|
-
Test::More is the tried and true testing library for Perl. It uses \s-1TAP
|
|
138
|
+
Test::More is the tried and true testing library for Perl. It uses \s-1TAP\s0 (the Test Anything Protocol). This is the same thing for Bash. For the most part it should work exactly the same.
|
|
135
139
|
.SH "Methods"
|
|
136
140
|
.IX Header "Methods"
|
|
137
141
|
This is the basic usage:
|
|
@@ -161,13 +165,15 @@ This is the basic usage:
|
|
|
161
165
|
\&\f(CW\*(C`plan skip_all "$reason"\*(C'\fR
|
|
162
166
|
.IP "\(bu" 4
|
|
163
167
|
\&\f(CW\*(C`BAIL_OUT "$reason"\*(C'\fR
|
|
168
|
+
.IP "\(bu" 4
|
|
169
|
+
`cmp\-array output expected \*(L"message\*(R"
|
|
164
170
|
.PP
|
|
165
171
|
More detailed info coming soon.
|
|
166
172
|
.SH "Author"
|
|
167
173
|
.IX Header "Author"
|
|
168
|
-
Ingy döt Net <ingy@
|
|
174
|
+
Ingy döt Net <ingy@ingy.net>
|
|
169
175
|
.SH "Copyright & License"
|
|
170
176
|
.IX Header "Copyright & License"
|
|
171
|
-
Copyright 2013\-
|
|
177
|
+
Copyright 2013\-2020. Ingy döt Net.
|
|
172
178
|
.PP
|
|
173
179
|
The \s-1MIT\s0 License (\s-1MIT\s0)
|
|
@@ -12,9 +12,23 @@ like "$output" 'not ok 2' \
|
|
|
12
12
|
'fail with no label'
|
|
13
13
|
like "$output" 'not ok 3 - is foo bar' \
|
|
14
14
|
'fail output is correct'
|
|
15
|
+
like "$output" 'not ok 4 - command output more' \
|
|
16
|
+
'fail output is correct'
|
|
17
|
+
like "$output" 'not ok 5 - command output less' \
|
|
18
|
+
'fail output is correct'
|
|
19
|
+
like "$output" 'not ok 6 - command output diff' \
|
|
20
|
+
'fail output is correct'
|
|
15
21
|
like "$output" "# got: 'foo'" \
|
|
16
22
|
'difference reporting - got'
|
|
17
23
|
like "$output" "# expected: 'bar'" \
|
|
18
24
|
'difference reporting - want'
|
|
19
25
|
|
|
20
|
-
|
|
26
|
+
like "$output" "line2. *\+line3." \
|
|
27
|
+
'array comparison (more)'
|
|
28
|
+
like "$output" "line1. *-line2." \
|
|
29
|
+
'array comparison (less)'
|
|
30
|
+
like "$output" "-line2.*\+foo" \
|
|
31
|
+
'array comparison (diff)'
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
done_testing 11
|
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
+
# shellcheck disable=2034
|
|
4
|
+
|
|
3
5
|
source test/setup
|
|
4
6
|
use Test::More
|
|
5
7
|
|
|
6
|
-
plan tests
|
|
8
|
+
plan tests 6
|
|
7
9
|
|
|
8
10
|
pass 'This test always passes'
|
|
9
11
|
|
|
10
12
|
is 'foo' "foo" 'foo is foo'
|
|
11
13
|
|
|
12
|
-
ok "
|
|
14
|
+
ok "$(true)" 'true is true'
|
|
13
15
|
|
|
14
|
-
ok "
|
|
16
|
+
ok "$([ 123 -eq "$((61+62))" ])" 'Math works'
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
# shellcheck disable=2050
|
|
19
|
+
ok "$([[ ! team =~ I ]])" "There's no I in team"
|
|
17
20
|
|
|
18
21
|
# diag "A msg for stderr"
|
|
19
22
|
|
|
20
23
|
note "A msg for stdout"
|
|
24
|
+
|
|
25
|
+
expected=(line1 line2)
|
|
26
|
+
|
|
27
|
+
command_output=(line1 line2 )
|
|
28
|
+
cmp-array command_output expected "command output more"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
set -e
|
|
3
|
+
set -e -u -o pipefail
|
|
4
4
|
|
|
5
|
-
BASHLIB
|
|
6
|
-
PATH
|
|
5
|
+
BASHLIB=$(find "$PWD" -type d | grep -E '/(bin|lib)$' | xargs -n1 printf "%s:")
|
|
6
|
+
PATH=$BASHLIB:$PATH
|
|
7
7
|
|
|
8
8
|
source bash+ :std
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
source test/setup
|
|
4
|
+
use Test::More
|
|
5
|
+
|
|
6
|
+
if ! command -v shellcheck >/dev/null; then
|
|
7
|
+
plan skip_all "The 'shellcheck' utility is not installed"
|
|
8
|
+
fi
|
|
9
|
+
if [[ ! $(shellcheck --version) =~ 0\.7\.1 ]]; then
|
|
10
|
+
plan skip_all "This test wants shellcheck version 0.7.1"
|
|
11
|
+
fi
|
|
12
|
+
|
|
13
|
+
IFS=$'\n' read -d '' -r -a shell_files <<< "$(
|
|
14
|
+
find lib -type f
|
|
15
|
+
echo test/setup
|
|
16
|
+
find test -name '*.t'
|
|
17
|
+
)" || true
|
|
18
|
+
|
|
19
|
+
skips=(
|
|
20
|
+
# We want to keep these 2 here always:
|
|
21
|
+
SC1090 # Can't follow non-constant source. Use a directive to specify location.
|
|
22
|
+
SC1091 # Not following: bash+ was not specified as input (see shellcheck -x).
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
skip=$(IFS=,; echo "${skips[*]}")
|
|
26
|
+
|
|
27
|
+
for file in "${shell_files[@]}"; do
|
|
28
|
+
[[ $file == *swp ]] && continue
|
|
29
|
+
is "$(shellcheck -e "$skip" "$file")" "" \
|
|
30
|
+
"The shell file '$file' passes shellcheck"
|
|
31
|
+
done
|
|
32
|
+
|
|
33
|
+
done_testing
|
|
34
|
+
|
|
35
|
+
# vim: set ft=sh:
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
+
# shellcheck disable=2034
|
|
4
|
+
|
|
3
5
|
source test/setup
|
|
4
6
|
use Test::More
|
|
5
7
|
|
|
@@ -9,4 +11,15 @@ fail
|
|
|
9
11
|
|
|
10
12
|
is foo bar 'is foo bar'
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
expected=(line1 line2)
|
|
15
|
+
|
|
16
|
+
command_output=(line1 line2 line3)
|
|
17
|
+
cmp-array command_output expected "command output more"
|
|
18
|
+
|
|
19
|
+
command_output=(line1)
|
|
20
|
+
cmp-array command_output expected "command output less"
|
|
21
|
+
|
|
22
|
+
command_output=(line1 foo)
|
|
23
|
+
cmp-array command_output expected "command output diff"
|
|
24
|
+
|
|
25
|
+
done_testing 6
|