Changeset 12586 for trunk/tests


Ignore:
Timestamp:
Aug 15, 2009, 2:42:56 PM (10 years ago)
Author:
gz
Message:

Tests for more compile-time defmethod checking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/ansi-tests/ccl.lsp

    r12582 r12586  
    14731473           t))
    14741474  t)
     1475
     1476
     1477(deftest ccl.61783-1
     1478    (test-compiler-warning "(defgeneric ccl.61783-1 (x y))
     1479                            (defmethod ccl.61783-1 ((x integer)) x)")
     1480  (:incongruent-method-lambda-list))
     1481
     1482(deftest ccl.61783-1-rev
     1483    (test-compiler-warning "(defmethod ccl.61783-1-rev ((x integer)) x)
     1484                            (defgeneric ccl.61783-1-rev (x y))")
     1485  (:incongruent-gf-lambda-list))
     1486
     1487
     1488(deftest ccl.61783-2
     1489    (test-compiler-warning "(defmethod ccl.61783-2 ((x integer)) x)
     1490                            (defmethod ccl.61783-2 ((x string) &key) x)")
     1491  (:incongruent-method-lambda-list))
     1492
     1493(deftest ccl.61783-3
     1494    (test-compiler-warning "(defgeneric ccl.61783-3 (&key a b))
     1495                            (defmethod ccl.61783-3 (&key a) a)")
     1496  (:gf-keys-not-accepted))
     1497
     1498(deftest ccl.61783-3-rev
     1499    (test-compiler-warning "(defmethod ccl.61783-3-rev (&key a) a)
     1500                            (defgeneric ccl.61783-3-rev (&key a b))")
     1501  (:gf-keys-not-accepted))
     1502
     1503(deftest ccl.61783-4
     1504    (test-compiler-warning "(defgeneric ccl.61783-4 (&key a))
     1505                            (defgeneric ccl.61783-4 (&key a))")
     1506  (:duplicate-definition))
     1507
     1508(deftest ccl.61783-5
     1509    (test-compiler-warning "(defmethod ccl.61783-5 ((x integer) &key a) a)
     1510                            (defun ccl.61783-5-caller () (ccl.61783-5 1 :a 12 :b 0))")
     1511  (:environment-mismatch))
     1512
     1513(deftest ccl.61783-5-rev
     1514    (test-compiler-warning "(defun ccl.61783-5-rev-caller () (ccl.61783-5-rev 1 :a 12 :b 0))
     1515                            (defmethod ccl.61783-5-rev ((x integer) &key a) a)")
     1516  (:environment-mismatch))
     1517
     1518
     1519(deftest ccl.61783-6
     1520    (test-compiler-warning "(defgeneric ccl.61783-6 (x &key a &allow-other-keys))
     1521                            (defun ccl.61783-6-caller () (ccl.61783-6 1 :a 12 :b 0))")
     1522  ())
     1523
     1524(deftest ccl.61783-6-rev
     1525    (test-compiler-warning "(defun ccl.61783-6-rev-caller () (ccl.61783-6-rev 1 :a 12 :b 0))
     1526                            (defgeneric ccl.61783-6-rev (x &key a &allow-other-keys))")
     1527  ())
     1528
     1529
Note: See TracChangeset for help on using the changeset viewer.