Filtering...

formals-tests

books/std/util/formals-tests
other
(in-package "STD")
other
(include-book "formals")
other
(include-book "std/testing/assert-bang" :dir :system)
other
(assert! (equal (remove-macro-args 'f '(a b c) nil)
    '(a b c)))
other
(assert! (equal (remove-macro-args 'f
      '(a b c &key d e)
      nil)
    '(a b c d e)))
other
(assert! (equal (remove-macro-args 'f
      '(a b c &key d &optional e)
      nil)
    '(a b c d e)))
other
(assert! (equal (remove-macro-args 'f
      '(a b c &optional d e)
      nil)
    '(a b c d e)))
other
(assert! (equal (remove-macro-args 'f
      '(a b c &key (d true-listp) e)
      nil)
    '(a b c (d true-listp) e)))
other
(assert! (equal (remove-macro-args 'f
      '(a b c &key (d 'true-listp) e)
      nil)
    '(a b c d e)))
other
(assert! (equal (remove-macro-args 'f
      '(a b c &key (d "foo") e)
      nil)
    '(a b c (d "foo") e)))
other
(assert! (equal (remove-macro-args 'f
      '(a b c &key (d '"foo") e)
      nil)
    '(a b c d e)))
other
(assert! (equal (remove-macro-args 'f
      '(a b
        c
        &key
        ((d atom) '3)
        (e true-listp))
      nil)
    '(a b
      c
      (d atom)
      (e true-listp))))
other
(assert! (equal (formals-for-macro 'f '(a b c) nil)
    '(a b c)))
other
(assert! (equal (formals-for-macro 'f
      '(a b c &key d e)
      nil)
    '(a b c &key d e)))
other
(assert! (equal (formals-for-macro 'f
      '(a b c &key d &optional e)
      nil)
    '(a b c &key d &optional e)))
other
(assert! (equal (formals-for-macro 'f
      '(a b c &optional d e)
      nil)
    '(a b c &optional d e)))
other
(assert! (equal (formals-for-macro 'f
      '(a b c &key (d true-listp) e)
      nil)
    '(a b c &key d e)))
other
(assert! (equal (formals-for-macro 'f
      '(a b c &key (d 'true-listp) e)
      nil)
    '(a b c &key (d 'true-listp) e)))
other
(assert! (equal (formals-for-macro 'f
      '(a b c &key (d "foo") e)
      nil)
    '(a b c &key d e)))
other
(assert! (equal (formals-for-macro 'f
      '(a b c &key (d '"foo") e)
      nil)
    '(a b c &key (d '"foo") e)))
other
(assert! (equal (formals-for-macro 'f
      '(a b
        c
        &key
        ((d atom) '3)
        (e true-listp))
      nil)
    '(a b c &key (d '3) e)))
other
(assert! (equal (make-wrapper-macro 'foo
      'foo-fn
      '(x y z))
    `(defmacro foo
      (x y z)
      (list 'foo-fn x y z))))
other
(assert! (equal (make-wrapper-macro 'foo
      'foo-fn
      '(x y &optional z))
    `(defmacro foo
      (x y &optional z)
      (list 'foo-fn x y z))))
other
(assert! (equal (make-wrapper-macro 'foo
      'foo-fn
      '(x y &optional (z '3)))
    `(defmacro foo
      (x y &optional (z '3))
      (list 'foo-fn x y z))))
other
(assert! (equal (make-wrapper-macro 'foo
      'foo-fn
      '(x y &key (z '3)))
    `(defmacro foo
      (x y &key (z '3))
      (list 'foo-fn x y z))))
other
(assert! (equal (make-wrapper-macro 'foo
      'foo-fn
      '(x y &optional (a '5) &key (z '3)))
    `(defmacro foo
      (x y &optional (a '5) &key (z '3))
      (list 'foo-fn x y a z))))