summaryrefslogtreecommitdiff
path: root/cl/tests/approx.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'cl/tests/approx.lisp')
-rw-r--r--cl/tests/approx.lisp23
1 files changed, 23 insertions, 0 deletions
diff --git a/cl/tests/approx.lisp b/cl/tests/approx.lisp
new file mode 100644
index 0000000..a458e66
--- /dev/null
+++ b/cl/tests/approx.lisp
@@ -0,0 +1,23 @@
+(defpackage lizfcm/tests.approx
+ (:use :cl
+ :fiveam
+ :lizfcm.approx
+ :lizfcm.utils
+ :lizfcm/tests)
+ (:export :approx-suite))
+(in-package :lizfcm/tests.approx)
+
+(def-suite approx-suite
+ :in lizfcm-test-suite)
+(in-suite approx-suite)
+
+(test derivative-at
+ :description "derivative at is within bounds"
+ (let ((f (lambda (x) (* x x)))
+ (x 2)
+ (f-prime-at-x 4)
+ (delta 0.01))
+ (is (within-range-p
+ (derivative-at f x delta)
+ f-prime-at-x
+ 0.1))))