12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- (use-modules
- ;; SRFI 64 for unit testing facilities
- (srfi srfi-64)
- ;; Utilities for testing
- #;(test-utils)
- ;; Dependencies for testing the code to be tested
- (data-point))
- (test-begin "data-point-test")
- (test-group
- "make-data-point"
- (test-equal "make-data-point-1"
- #(a 1 2 3)
- (make-data-point 'a 1 2 3)))
- (test-group
- "data-point-length"
- (test-equal "data-point-length-1"
- 5
- (data-point-length #(0.1 0.2 0.3245 123.213432 'a))))
- (test-group
- "data-point-get-col"
- (test-equal "data-point-get-col-1"
- (data-point-get-col #(0 32 478 282 1) 1)
- 32)
- (test-equal "data-point-get-col-2"
- (data-point-get-col #(0 32 478 282 1) 0)
- 0))
- (test-group
- "data-point-set-col!"
- (let ([a-data-point (make-data-point 0 32 478 282 1)])
- (data-point-set-col! a-data-point 1 64)
- (test-equal "data-point-set-col!-1"
- a-data-point
- (make-data-point 0 64 478 282 1))))
- (test-group
- "data-point-take"
- (test-equal "data-point-take-1"
- (make-data-point 'a 'b 'c 100)
- (data-point-take (make-data-point 'a 'b 'c 100 30 1) 4)))
- (test-group
- "data-point-take-features"
- (test-equal
- #(0 1 2 3)
- (data-point-take-features #(0 1 2 3 4) 4))
- (test-equal
- #(10 9 8)
- (data-point-take-features #(10 9 8 4) 3)))
- (test-end "data-point-test")
|