Skip to content

Commit dc5be6e

Browse files
committed
chore: Fix test files summary
1 parent 97e4b30 commit dc5be6e

File tree

9 files changed

+61
-9
lines changed

9 files changed

+61
-9
lines changed

src/util.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ function _global_options(argv) {
167167
flags.push(def_flag(argv['log-file'], (argv['log-file']) ? '--log-file' : '--no-log-file'));
168168
flags.push(def_flag(argv['elapsed-time'], (argv['elapsed-time']) ? '--elapsed-time' : '--no-elapsed-time'));
169169
flags.push(def_flag(argv['no-color'], '--no-color'));
170-
/* Number type */
170+
/* Numeric type */
171171
flags.push(def_flag(argv.verbose, '--verbose', argv.verbose));
172172
/* String type */
173173
flags.push(def_flag(argv.proxy, '--proxy', argv.proxy));
@@ -177,6 +177,23 @@ function _global_options(argv) {
177177
return flags;
178178
}
179179

180+
/**
181+
* Check any invalid arguments or options.
182+
* @param { JSON } (argv - Argument vector.
183+
* @return Return true if there is no input error.
184+
*/
185+
function _check_argv(argv) {
186+
/* Numeric type */
187+
if (argv.verbose !== undefined &&
188+
// this must exclude NaN -- yargs default value for numeric type
189+
!(argv.verbose >= 0 && argv.verbose <= 5)) {
190+
console.warn("invalid value for --verbose option: must be a number between 0 and 5");
191+
return false;
192+
}
193+
194+
return true;
195+
}
196+
180197
/**
181198
* Form elisp script path.
182199
* @param { string } name - Name of the script without extension.
@@ -212,6 +229,11 @@ async function e_call(argv, script, ...args) {
212229
return;
213230
}
214231

232+
if (!_check_argv(avrg)) {
233+
process.exit(1);
234+
return;
235+
}
236+
215237
return new Promise(resolve => {
216238
let _path = el_script(script);
217239

test/jest/lint/checkdoc-fail.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; ert-test.el --- Test the command ert -*- lexical-binding: t; -*-
1+
;;; checkdoc-fail.el --- Test checkdoc fail -*- lexical-binding: t; -*-
22

33
;; Copyright (C) 2025 the Eask authors.
44

@@ -26,4 +26,4 @@
2626
2727
in this " ignore)
2828

29-
;;; declare-ok.el ends here
29+
;;; checkdoc-fail.el ends here

test/jest/lint/declare-fail.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; declare-fail.el --- Test lint declare -*- lexical-binding: t; -*-
1+
;;; declare-fail.el --- Test declare-fail -*- lexical-binding: t; -*-
22

33
;; Copyright (C) 2025 the Eask authors.
44

test/jest/lint/declare-ok.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; ert-test.el --- Test the command ert -*- lexical-binding: t; -*-
1+
;;; declare-ok.el --- Test declare-ok -*- lexical-binding: t; -*-
22

33
;; Copyright (C) 2025 the Eask authors.
44

test/jest/lint/elisp-lint-ok.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; elisp-lint-ok.el --- Test the linting -*- lexical-binding: t; -*-
1+
;;; elisp-lint-ok.el --- Test elisp-lint-ok -*- lexical-binding: t; -*-
22

33
;; Copyright (C) 2025 the Eask authors.
44

test/jest/lint/elsa-warn.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; elsa-warn.el --- Test elsa linting -*- lexical-binding: t; -*-
1+
;;; elsa-warn.el --- Test elsa-warn -*- lexical-binding: t; -*-
22

33
;; Copyright (C) 2025 the Eask authors.
44

test/jest/lint/indent-warn.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; indent-warn.el --- Test indent linting -*- lexical-binding: t; -*-
1+
;;; indent-warn.el --- Test indent-warn -*- lexical-binding: t; -*-
22

33
;; Copyright (C) 2025 the Eask authors.
44

test/jest/lint/regexp-warn.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; regexp-warn.el --- Test regexp linting -*- lexical-binding: t; -*-
1+
;;; regexp-warn.el --- Test regexp-warn -*- lexical-binding: t; -*-
22

33
;; Copyright (C) 2025 the Eask authors.
44

test/jest/options/options.el

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
;;; options.el --- Test options -*- lexical-binding: t; -*-
2+
3+
;; Copyright (C) 2025 the Eask authors.
4+
5+
;; This file is not part of GNU Emacs.
6+
7+
;; This program is free software: you can redistribute it and/or modify
8+
;; it under the terms of the GNU General Public License as published by
9+
;; the Free Software Foundation, either version 3 of the License, or
10+
;; (at your option) any later version.
11+
12+
;; This program is distributed in the hope that it will be useful,
13+
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
;; GNU General Public License for more details.
16+
17+
;; You should have received a copy of the GNU General Public License
18+
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
19+
20+
;;; Commentary:
21+
;;
22+
;; Test options.
23+
;;
24+
25+
;;; Code:
26+
27+
;; Empty..
28+
29+
(provide 'options)
30+
;;; options.el ends here

0 commit comments

Comments
 (0)