aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gtwiwtg-test.asd9
-rw-r--r--gtwiwtg-test.lisp87
2 files changed, 0 insertions, 96 deletions
diff --git a/gtwiwtg-test.asd b/gtwiwtg-test.asd
deleted file mode 100644
index cba85d5..0000000
--- a/gtwiwtg-test.asd
+++ /dev/null
@@ -1,9 +0,0 @@
-;;;; gtwiwtg-test.asd
-
-(asdf:defsystem #:gtwiwtg-test
- :description "tests for gtwiwtg"
- :author "Colin Okay <colin@cicadas.surf>"
- :license "GPLv3"
- :version "0.1.0"
- :depends-on (:gtwiwtg)
- :components ((:file "gtwiwtg-test")))
diff --git a/gtwiwtg-test.lisp b/gtwiwtg-test.lisp
deleted file mode 100644
index e1fbab6..0000000
--- a/gtwiwtg-test.lisp
+++ /dev/null
@@ -1,87 +0,0 @@
-(defpackage :gtwiwtg-test
- (:use :cl :gtwiwtg))
-
-(in-package :gtwiwtg-test)
-
-(defun gtwiwtg::test-resumables ()
- (let ((foobar
- (make-resumable! (range))))
- (take 10 foobar)
- (setf foobar (resume! foobar))
- (assert (equal (take 10 foobar)
- '(10 11 12 13 14 15 16 17 18 19)))))
-
-(defun gtwiwtg::test-inflate! ()
- (let* ((keys (seq '(:name :occupation :hobbies)))
- (vals (seq '("Buckaroo Banzai"
- "Rocker"
- ("Neuroscience" "Particle Physics" "Piloting Fighter Jets")))))
- (assert
- (equal (collect (inflate! #'seq (zip! keys vals)))
- '(:name "Buckaroo Banzai"
- :occupation "Rocker"
- :hobbies ("Neuroscience" "Particle Physics" "Piloting Fighter Jets"))))))
-
-(defun gtwiwtg::test-concat! ()
- (equal
- '(1 2 3 a b c :e :f :g)
- (collect (concat! (range :from 1 :to 4)
- (seq '(a b c))
- (seq '(:e :f :g))))))
-
-(defun gtwiwtg::test-merge! ()
- (assert (equal
- '(-10 -4 0 1 2 2 3 4 6 8 8 14 20 26)
- (collect
- (merge! #'<
- (times 4)
- (range :from 4 :to 10 :by 2)
- (range :from -10 :to 28 :by 6))))))
-
-(defun gtwiwtg::test-intersperse! ()
- (assert
- (equal
- '(:NAME "buckaroo banzai" :JOB "rocker" :HOBBIES
- ("neuroscience" "particle physics" "flying fighter jets"))
- (collect
- (intersperse! (seq '(:name :job :hobbies))
- (seq '("buckaroo banzai"
- "rocker"
- ("neuroscience"
- "particle physics"
- "flying fighter jets"))))))))
-
-(defun gtwiwtg::test-collect ()
- (assert (equal '(1 2 3 4) (collect (range :from 1 :to 4 :inclusive t))))
- (assert (equal '(1 2 3 4) (collect (range :from 1 :to 5))))
- (assert (equal '((1 #\a) (2 #\b) (3 #\c))
- (collect
- (zip! (range :from 1)
- (seq "abc")))))
- (assert (null (collect (seq ())))))
-
-(defun gtwiwtg::test-take ()
- (assert (null (take 100 (seq ""))))
- (assert (equal '(#\a #\b #\c) (take 100 (seq "abc"))))
- (assert (equal '(#\a #\b) (take 2 (seq "abcdefg")))))
-
-
-(defun gtwiwtg::test-pick-out ()
- (assert
- (equal '(40 30 20)
- (pick-out '(3 2 1)
- (range :from 10 :by 10))))
- (assert
- (equal '(101)
- (pick-out '(101)
- (range)))))
-
-(defun gtwiwtg::test-argmax ()
- (assert (equal '(-10 . 100)
- (argmax (lambda (x) (* x x))
- (seq '(1 -10 3 4 -4))))))
-
-(defun gtwiwtg::test-argmin ()
- (assert (equal '(1 . 1)
- (argmin (lambda (x) (* x x))
- (seq '(1 -10 3 4 -4))))))