tests.lisp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. ;; Copyright (c) 2008 Accelerated Data Works, Ryan Davis
  2. ;; Permission is hereby granted, free of charge, to any person
  3. ;; obtaining a copy of this software and associated documentation files
  4. ;; (the "Software"), to deal in the Software without restriction,
  5. ;; including without limitation the rights to use, copy, modify, merge,
  6. ;; publish, distribute, sublicense, and/or sell copies of the Software,
  7. ;; and to permit persons to whom the Software is furnished to do so,
  8. ;; subject to the following conditions:
  9. ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  10. ;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  11. ;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  12. ;; IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  13. ;; CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  14. ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  15. ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  16. (in-package :adw-charting-tests)
  17. (define-test pie-chart-total
  18. (assert-equal 10 (adw-charting::total (make-instance 'adw-charting::pie-chart :total 10))))
  19. (define-test pie-chart-calculated-total
  20. "tests summing the pie-chart total from the data items"
  21. (assert-equal 45
  22. (with-pie-chart (400 400)
  23. (add-slice "A" 10)
  24. (add-slice "B" 15)
  25. (add-slice "C" 20)
  26. (adw-charting::total adw-charting::*current-chart*))))
  27. ;;;;test that the example programs run
  28. (define-test examples
  29. (assert-true (and (minimal-pie-chart)
  30. (minimal-line-chart)
  31. (customized-line-chart)
  32. (boinkmark))))