-;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
+;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Package: kmrcl-tests -*-
;;;; *************************************************************************
;;;; FILE IDENTIFICATION
;;;;
;;;; Author: Kevin M. Rosenberg
;;;; Date Started: Apr 2003
;;;;
-;;;; $Id: tests.lisp,v 1.22 2003/07/16 16:01:37 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg
;;;;
(deftest css.4 (concat-separated-strings "|" '("ab" "cd") nil) "ab|cd")
(deftest css.5 (concat-separated-strings "|" '("ab" "cd") nil '("ef")) "ab|cd|ef")
-(deftest f.1 (filter #'(lambda (x) (when (oddp x) (* x x)))
+(deftest f.1 (map-and-remove-nils #'(lambda (x) (when (oddp x) (* x x)))
'(0 1 2 3 4 5 6 7 8 9)) (1 9 25 49 81))
+(deftest f.2 (filter #'(lambda (x) (when (oddp x) (* x x)))
+ '(0 1 2 3 4 5 6 7 8 9)) (1 3 5 7 9))
(deftest an.1 (appendnew '(a b c d) '(c c e f)) (a b c d e f))
(deftest sse.4 (string-strip-ending "abc" '("ab")) "abc")
(deftest sse.5 (string-strip-ending "abcd" '("a" "cd")) "ab")
+(deftest gopt.1 (getopt '("argv") nil) ("argv") nil nil)
+(deftest gopt.2 (getopt '("argv" "2") nil) ("argv" "2") nil nil)
+(deftest gopt.3 (getopt '("argv" "-c") '(("c" :none))) ("argv") (("c")) nil)
+(deftest gopt.4 (getopt '("argv" "-c" "val") '(("c" :optional))) ("argv") (("c" . "val")) nil)
+(deftest gopt.5 (getopt '("argv" "-c" "val" "v1") '(("c" :optional))) ("argv" "v1") (("c" . "val")) nil)
+(deftest gopt.6 (getopt '("--colon" "val" "v1") '(("colon" :optional))) ( "v1") (("colon" . "val")) nil)
+(deftest gopt.7 (getopt '("ab" "--colon" "val" "--" "-c") '(("colon" :optional) ("-c" :none))) ("ab" "-c") (("colon" . "val")) nil)
+(deftest gopt.8 (getopt '("argv" "-c" "cd") '(("c" :required))) ("argv") (("c" . "cd")) nil)
+(deftest gopt.9 (getopt '("argv" "-c") '(("c" :required))) ("argv") nil ("c"))
+
;;; MOP Testing
(eval-when (:compile-toplevel :load-toplevel :execute)