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.180 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.179 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.178 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.177 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.176 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.175 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.174 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.173 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.172 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.171 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.170 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.169 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.167 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.166 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.165 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.164 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.163 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.162 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.161 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp
trackler-2.2.1.160 tracks/common-lisp/exercises/pascals-triangle/pascals-triangle-test.lisp