Sha256: bc4431a7695f2df986cbf3d4d51eed6b9b81ff14b12dc23172afbe00533d4621

Contents?: true

Size: 799 Bytes

Versions: 185

Compression:

Stored size: 799 Bytes

Contents

(ql:quickload "lisp-unit")
#-xlisp-test (load "pascal")

(defpackage #:pascal-test
  (:use #:common-lisp #:lisp-unit))
(in-package #:pascal-test)

(define-test zero-rows
    (assert-equal '()
                  (pascal:rows 0)))

(define-test single-row
    (assert-equal '((1))
                  (pascal:rows 1)))

(define-test two-rows
    (assert-equal '((1) (1 1))
                  (pascal:rows 2)))

(define-test three-rows
    (assert-equal '((1) (1 1) (1 2 1))
                  (pascal:rows 3)))

(define-test four-rows
    (assert-equal '((1) (1 1) (1 2 1) (1 3 3 1))
                  (pascal:rows 4)))

(define-test negative-rows
    (assert-equal '()
                  (pascal:rows -1)))
#-xlisp-test
(let ((*print-errors* t)
      (*print-failures* t))
  (run-tests :all :pascal-test))

Version data entries

185 entries across 185 versions & 1 rubygems

Version Path
trackler-2.2.1.119 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.118 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.117 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.116 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.115 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.114 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.113 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.111 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.110 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.109 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.108 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.107 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.106 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.105 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.104 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.103 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.102 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.101 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.100 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.99 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp