3 MES=${MES-$(dirname $0)/../scripts/mes}
4 echo ' ()' | cat $(dirname $0)/../module/mes/base-0.mes $0 /dev/stdin | $MES $MES_FLAGS "$@"
11 ;;; Mes --- Maxwell Equations of Software
12 ;;; Copyright © 2017,2018 Jan Nieuwenhuizen <janneke@gnu.org>
14 ;;; This file is part of Mes.
16 ;;; Mes is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
21 ;;; Mes is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;;; GNU General Public License for more details.
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
31 (use-modules (mes getopt-long)))
33 (mes-use-module (mes getopt-long))
34 (mes-use-module (mes test))))
36 (pass-if "first dummy" #t)
37 (pass-if-not "second dummy" #f)
39 (define option-spec '((help (single-char #\h))
40 (include (single-char #\I) (value #t))
41 (version (single-char #\V))))
43 (pass-if-equal "getopt" '((() "bar"))
44 (getopt-long '("foo" "bar") option-spec))
46 (pass-if-equal "getopt2" '((() "bar" "baz"))
47 (getopt-long '("foo" "bar" "baz") option-spec))
49 (pass-if-equal "getopt --help" '((()) (help . #t))
50 (getopt-long '("foo" "--help") option-spec))
52 (pass-if-equal "getopt -hVI5d" '((()) (include . "5d") (version . #t) (help . #t))
53 (getopt-long '("foo" "-hVI5d") option-spec))
55 (pass-if-equal "getopt -I." '((()) (include . "."))
56 (getopt-long '("foo" "-I.") option-spec))
58 (pass-if-equal "getopt -I foo ..." '((()) (include . "lib") (include . "include"))
59 (getopt-long '("foo" "-I" "include" "-I" "lib") option-spec))