1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
|
From 084d6cf54ce9acda6d2e296a2ba2c99f1cf8807c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Matt=C3=A9o=20Rossillol=E2=80=91=E2=80=91Laruelle?=
<beatussum@protonmail.com>
Date: Wed, 7 Aug 2024 12:10:47 +0200
Subject: [PATCH] fix tests
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This commit fixes warnings that occur during tests.
This commit is based on 699ebb52a569311a55b45f1bc4038d37b9a1de8e and was created
using `git bisect`.
See-also: 699ebb52a569311a55b45f1bc4038d37b9a1de8e
Signed-off-by: Mattéo Rossillol‑‑Laruelle <beatussum@protonmail.com>
---
lib/core/matchers.sh | 5 ++++-
lib/core/modifiers/contents.sh | 10 ++++++++--
lib/core/modifiers/length.sh | 5 ++++-
lib/core/modifiers/line.sh | 5 ++++-
lib/core/modifiers/lines.sh | 5 ++++-
lib/core/modifiers/result.sh | 5 ++++-
lib/core/modifiers/word.sh | 5 ++++-
lib/core/subjects/line.sh | 5 ++++-
lib/core/subjects/path.sh | 5 ++++-
lib/core/subjects/status.sh | 5 ++++-
lib/core/subjects/stderr.sh | 10 ++++++++--
lib/core/subjects/stdout.sh | 10 ++++++++--
lib/core/subjects/value.sh | 5 ++++-
lib/core/subjects/variable.sh | 5 ++++-
lib/core/subjects/word.sh | 5 ++++-
15 files changed, 72 insertions(+), 18 deletions(-)
diff --git a/lib/core/matchers.sh b/lib/core/matchers.sh
index 8c3acf3..0468338 100644
--- a/lib/core/matchers.sh
+++ b/lib/core/matchers.sh
@@ -17,7 +17,10 @@ shellspec_matcher() {
unset SHELLSPEC_EXPECT ||:
- eval shellspec_syntax_dispatch matcher ${1+'"$@"'}
+ case $# in
+ 0) shellspec_syntax_dispatch matcher ;;
+ *) shellspec_syntax_dispatch matcher "$@" ;;
+ esac
}
shellspec_matcher_do_match_positive() {
diff --git a/lib/core/modifiers/contents.sh b/lib/core/modifiers/contents.sh
index 434f9af..a8169df 100644
--- a/lib/core/modifiers/contents.sh
+++ b/lib/core/modifiers/contents.sh
@@ -12,7 +12,10 @@ shellspec_modifier_contents() {
unset SHELLSPEC_SUBJECT ||:
fi
- eval shellspec_syntax_dispatch modifier ${1+'"$@"'}
+ case $# in
+ 0) shellspec_syntax_dispatch modifier ;;
+ *) shellspec_syntax_dispatch modifier "$@" ;;
+ esac
}
shellspec_modifier_entire_contents() {
@@ -24,5 +27,8 @@ shellspec_modifier_entire_contents() {
unset SHELLSPEC_SUBJECT ||:
fi
- eval shellspec_syntax_dispatch modifier ${1+'"$@"'}
+ case $# in
+ 0) shellspec_syntax_dispatch modifier ;;
+ *) shellspec_syntax_dispatch modifier "$@" ;;
+ esac
}
diff --git a/lib/core/modifiers/length.sh b/lib/core/modifiers/length.sh
index 6b9608f..ef0fad8 100644
--- a/lib/core/modifiers/length.sh
+++ b/lib/core/modifiers/length.sh
@@ -11,5 +11,8 @@ shellspec_modifier_length() {
unset SHELLSPEC_SUBJECT ||:
fi
- eval shellspec_syntax_dispatch modifier ${1+'"$@"'}
+ case $# in
+ 0) shellspec_syntax_dispatch modifier ;;
+ *) shellspec_syntax_dispatch modifier "$@" ;;
+ esac
}
diff --git a/lib/core/modifiers/line.sh b/lib/core/modifiers/line.sh
index 5cba66a..4dc842b 100644
--- a/lib/core/modifiers/line.sh
+++ b/lib/core/modifiers/line.sh
@@ -17,5 +17,8 @@ shellspec_modifier_line() {
fi
shift
- eval shellspec_syntax_dispatch modifier ${1+'"$@"'}
+ case $# in
+ 0) shellspec_syntax_dispatch modifier ;;
+ *) shellspec_syntax_dispatch modifier "$@" ;;
+ esac
}
diff --git a/lib/core/modifiers/lines.sh b/lib/core/modifiers/lines.sh
index 446d23e..c73496c 100644
--- a/lib/core/modifiers/lines.sh
+++ b/lib/core/modifiers/lines.sh
@@ -11,5 +11,8 @@ shellspec_modifier_lines() {
unset SHELLSPEC_SUBJECT ||:
fi
- eval shellspec_syntax_dispatch modifier ${1+'"$@"'}
+ case $# in
+ 0) shellspec_syntax_dispatch modifier ;;
+ *) shellspec_syntax_dispatch modifier "$@" ;;
+ esac
}
diff --git a/lib/core/modifiers/result.sh b/lib/core/modifiers/result.sh
index 524cd8f..43dd62f 100644
--- a/lib/core/modifiers/result.sh
+++ b/lib/core/modifiers/result.sh
@@ -24,7 +24,10 @@ shellspec_modifier_result() {
unset SHELLSPEC_SUBJECT ||:
fi
- eval shellspec_syntax_dispatch modifier ${1+'"$@"'}
+ case $# in
+ 0) shellspec_syntax_dispatch modifier ;;
+ *) shellspec_syntax_dispatch modifier "$@" ;;
+ esac
}
shellspec_modifier_result_invoke() {
diff --git a/lib/core/modifiers/word.sh b/lib/core/modifiers/word.sh
index 5d0e05a..328a296 100644
--- a/lib/core/modifiers/word.sh
+++ b/lib/core/modifiers/word.sh
@@ -17,5 +17,8 @@ shellspec_modifier_word() {
fi
shift
- eval shellspec_syntax_dispatch modifier ${1+'"$@"'}
+ case $# in
+ 0) shellspec_syntax_dispatch modifier ;;
+ *) shellspec_syntax_dispatch modifier "$@" ;;
+ esac
}
diff --git a/lib/core/subjects/line.sh b/lib/core/subjects/line.sh
index af338d1..d2638cb 100644
--- a/lib/core/subjects/line.sh
+++ b/lib/core/subjects/line.sh
@@ -17,5 +17,8 @@ shellspec_subject_line() {
fi
shellspec_off UNHANDLED_STDOUT
- eval shellspec_syntax_dispatch modifier line ${1+'"$@"'}
+ case $# in
+ 0) shellspec_syntax_dispatch modifier line ;;
+ *) shellspec_syntax_dispatch modifier line "$@" ;;
+ esac
}
diff --git a/lib/core/subjects/path.sh b/lib/core/subjects/path.sh
index b381589..ddefa9e 100644
--- a/lib/core/subjects/path.sh
+++ b/lib/core/subjects/path.sh
@@ -19,5 +19,8 @@ shellspec_subject_path() {
shift
- eval shellspec_syntax_dispatch modifier ${1+'"$@"'}
+ case $# in
+ 0) shellspec_syntax_dispatch modifier ;;
+ *) shellspec_syntax_dispatch modifier "$@" ;;
+ esac
}
diff --git a/lib/core/subjects/status.sh b/lib/core/subjects/status.sh
index 7825d14..43f50cd 100644
--- a/lib/core/subjects/status.sh
+++ b/lib/core/subjects/status.sh
@@ -14,5 +14,8 @@ shellspec_subject_status() {
shellspec_off UNHANDLED_STATUS
- eval shellspec_syntax_dispatch modifier ${1+'"$@"'}
+ case $# in
+ 0) shellspec_syntax_dispatch modifier ;;
+ *) shellspec_syntax_dispatch modifier "$@" ;;
+ esac
}
diff --git a/lib/core/subjects/stderr.sh b/lib/core/subjects/stderr.sh
index 8efc050..b5b7f79 100644
--- a/lib/core/subjects/stderr.sh
+++ b/lib/core/subjects/stderr.sh
@@ -18,7 +18,10 @@ shellspec_subject_stderr() {
shellspec_off UNHANDLED_STDERR
- eval shellspec_syntax_dispatch modifier ${1+'"$@"'}
+ case $# in
+ 0) shellspec_syntax_dispatch modifier ;;
+ *) shellspec_syntax_dispatch modifier "$@" ;;
+ esac
}
shellspec_subject_entire_stderr() {
@@ -33,5 +36,8 @@ shellspec_subject_entire_stderr() {
shellspec_off UNHANDLED_STDERR
- eval shellspec_syntax_dispatch modifier ${1+'"$@"'}
+ case $# in
+ 0) shellspec_syntax_dispatch modifier ;;
+ *) shellspec_syntax_dispatch modifier "$@" ;;
+ esac
}
diff --git a/lib/core/subjects/stdout.sh b/lib/core/subjects/stdout.sh
index 43306d6..d73284c 100644
--- a/lib/core/subjects/stdout.sh
+++ b/lib/core/subjects/stdout.sh
@@ -18,7 +18,10 @@ shellspec_subject_stdout() {
shellspec_off UNHANDLED_STDOUT
- eval shellspec_syntax_dispatch modifier ${1+'"$@"'}
+ case $# in
+ 0) shellspec_syntax_dispatch modifier ;;
+ *) shellspec_syntax_dispatch modifier "$@" ;;
+ esac
}
shellspec_subject_entire_stdout() {
@@ -33,5 +36,8 @@ shellspec_subject_entire_stdout() {
shellspec_off UNHANDLED_STDOUT
- eval shellspec_syntax_dispatch modifier ${1+'"$@"'}
+ case $# in
+ 0) shellspec_syntax_dispatch modifier ;;
+ *) shellspec_syntax_dispatch modifier "$@" ;;
+ esac
}
diff --git a/lib/core/subjects/value.sh b/lib/core/subjects/value.sh
index 3f3153e..773f021 100644
--- a/lib/core/subjects/value.sh
+++ b/lib/core/subjects/value.sh
@@ -12,5 +12,8 @@ shellspec_subject_value() {
SHELLSPEC_SUBJECT=$1
shift
- eval shellspec_syntax_dispatch modifier ${1+'"$@"'}
+ case $# in
+ 0) shellspec_syntax_dispatch modifier ;;
+ *) shellspec_syntax_dispatch modifier "$@" ;;
+ esac
}
diff --git a/lib/core/subjects/variable.sh b/lib/core/subjects/variable.sh
index c408eeb..559cc60 100644
--- a/lib/core/subjects/variable.sh
+++ b/lib/core/subjects/variable.sh
@@ -14,5 +14,8 @@ shellspec_subject_variable() {
fi
shift
- eval shellspec_syntax_dispatch modifier ${1+'"$@"'}
+ case $# in
+ 0) shellspec_syntax_dispatch modifier ;;
+ *) shellspec_syntax_dispatch modifier "$@" ;;
+ esac
}
diff --git a/lib/core/subjects/word.sh b/lib/core/subjects/word.sh
index db38b82..e52df10 100644
--- a/lib/core/subjects/word.sh
+++ b/lib/core/subjects/word.sh
@@ -17,5 +17,8 @@ shellspec_subject_word() {
fi
shellspec_off UNHANDLED_STDOUT
- eval shellspec_syntax_dispatch modifier word ${1+'"$@"'}
+ case $# in
+ 0) shellspec_syntax_dispatch modifier word ;;
+ *) shellspec_syntax_dispatch modifier word "$@" ;;
+ esac
}
--
2.44.2
|