diff options
author | Daniel Llorens <daniel.llorens@bluewin.ch> | 2016-12-26 21:41:17 +0100 |
---|---|---|
committer | Daniel Llorens <daniel.llorens@bluewin.ch> | 2017-01-09 09:02:04 +0100 |
commit | 7e93950552cd9e85a1f3eb73faf16e8423b0fbbe (patch) | |
tree | 8fc4e99ba4ccebd341cd49ae1602b824bfa9ceb3 /test-suite | |
parent | 2976abdbbbf4274dd4aabf12b50a1bea49882078 (diff) |
Final names for new array functions
Globally rename (array-from* -> array-slice), (array-from ->
array-cell-ref), (array-amend! -> array-cell-set!), (array-for-each-cell
-> array-slice-for-each).
Diffstat (limited to 'test-suite')
-rw-r--r-- | test-suite/tests/array-map.test | 10 | ||||
-rw-r--r-- | test-suite/tests/arrays.test | 48 |
2 files changed, 29 insertions, 29 deletions
diff --git a/test-suite/tests/array-map.test b/test-suite/tests/array-map.test index 3095b78f4..347184112 100644 --- a/test-suite/tests/array-map.test +++ b/test-suite/tests/array-map.test @@ -509,29 +509,29 @@ (array-for-each (lambda (b c) (set! a (cons* b c a))) b c))))) ;;; -;;; array-for-each-cell +;;; array-slice-for-each ;;; -(with-test-prefix "array-for-each-cell" +(with-test-prefix "array-slice-for-each" (pass-if-equal "1 argument frame rank 1" #2((1 3 9) (2 7 8)) (let* ((a (list->array 2 '((9 1 3) (7 8 2))))) - (array-for-each-cell 1 (lambda (a) (sort! a <)) a) + (array-slice-for-each 1 (lambda (a) (sort! a <)) a) a)) (pass-if-equal "2 arguments frame rank 1" #f64(8 -1) (let* ((x (list->typed-array 'f64 2 '((9 1) (7 8)))) (y (f64vector 99 99))) - (array-for-each-cell 1 (lambda (y x) (array-set! y (- (array-ref x 0) (array-ref x 1)))) y x) + (array-slice-for-each 1 (lambda (y x) (array-set! y (- (array-ref x 0) (array-ref x 1)))) y x) y)) (pass-if-equal "regression: zero-sized frame loop without unrolling" 99 (let* ((x 99) (o (make-array 0. 0 3 2))) - (array-for-each-cell 2 + (array-slice-for-each 2 (lambda (o a0 a1) (set! x 0)) o diff --git a/test-suite/tests/arrays.test b/test-suite/tests/arrays.test index 4c943dd41..1df77b1ba 100644 --- a/test-suite/tests/arrays.test +++ b/test-suite/tests/arrays.test @@ -298,110 +298,110 @@ ;;; -;;; array-from* +;;; array-slice ;;; -(with-test-prefix/c&e "array-from*" +(with-test-prefix/c&e "array-slice" (pass-if "vector I" (let ((v (vector 1 2 3))) - (array-fill! (array-from* v 1) 'a) + (array-fill! (array-slice v 1) 'a) (array-equal? v #(1 a 3)))) (pass-if "vector II" (let ((v (vector 1 2 3))) - (array-copy! #(a b c) (array-from* v)) + (array-copy! #(a b c) (array-slice v)) (array-equal? v #(a b c)))) (pass-if "array I" (let ((a (list->array 2 '((1 2 3) (4 5 6))))) - (array-fill! (array-from* a 1 1) 'a) + (array-fill! (array-slice a 1 1) 'a) (array-equal? a #2((1 2 3) (4 a 6))))) (pass-if "array II" (let ((a (list->array 2 '((1 2 3) (4 5 6))))) - (array-copy! #(a b c) (array-from* a 1)) + (array-copy! #(a b c) (array-slice a 1)) (array-equal? a #2((1 2 3) (a b c))))) (pass-if "array III" (let ((a (list->array 2 '((1 2 3) (4 5 6))))) - (array-copy! #2((a b c) (x y z)) (array-from* a)) + (array-copy! #2((a b c) (x y z)) (array-slice a)) (array-equal? a #2((a b c) (x y z))))) (pass-if "rank 0 array" (let ((a (make-array 77))) - (array-fill! (array-from* a) 'a) + (array-fill! (array-slice a) 'a) (array-equal? a #0(a))))) ;;; -;;; array-from +;;; array-cell-ref ;;; -(with-test-prefix/c&e "array-from" +(with-test-prefix/c&e "array-cell-ref" (pass-if "vector I" (let ((v (vector 1 2 3))) - (equal? 2 (array-from v 1)))) + (equal? 2 (array-cell-ref v 1)))) (pass-if "vector II" (let ((v (vector 1 2 3))) - (array-copy! #(a b c) (array-from v)) + (array-copy! #(a b c) (array-cell-ref v)) (array-equal? v #(a b c)))) (pass-if "array I" (let ((a (list->array 2 '((1 2 3) (4 5 6))))) - (equal? 5 (array-from a 1 1)))) + (equal? 5 (array-cell-ref a 1 1)))) (pass-if "array II" (let ((a (list->array 2 '((1 2 3) (4 5 6))))) - (array-copy! #(a b c) (array-from a 1)) + (array-copy! #(a b c) (array-cell-ref a 1)) (array-equal? a #2((1 2 3) (a b c))))) (pass-if "array III" (let ((a (list->array 2 '((1 2 3) (4 5 6))))) - (array-copy! #2((a b c) (x y z)) (array-from a)) + (array-copy! #2((a b c) (x y z)) (array-cell-ref a)) (array-equal? a #2((a b c) (x y z))))) (pass-if "rank 0 array" (let ((a (make-array 77))) - (equal? (array-from a) 77)))) + (equal? (array-cell-ref a) 77)))) ;;; -;;; array-amend! +;;; array-cell-set! ;;; -(with-test-prefix/c&e "array-amend!" +(with-test-prefix/c&e "array-cell-set!" (pass-if "vector I" (let ((v (vector 1 2 3))) - (and (eq? v (array-amend! v 'x 1)) + (and (eq? v (array-cell-set! v 'x 1)) (array-equal? v #(1 x 3))))) (pass-if "vector II" (let ((v (vector 1 2 3))) - (and (eq? v (array-amend! (array-from v) #(a b c))) + (and (eq? v (array-cell-set! (array-cell-ref v) #(a b c))) (array-equal? v #(a b c))))) (pass-if "array I" (let ((a (list->array 2 '((1 2 3) (4 5 6))))) - (and (eq? a (array-amend! a 'x 1 1)) + (and (eq? a (array-cell-set! a 'x 1 1)) (array-equal? a #2((1 2 3) (4 x 6)))))) (pass-if "array II" (let ((a (list->array 2 '((1 2 3) (4 5 6))))) - (and (eq? a (array-amend! a #(a b c) 1)) + (and (eq? a (array-cell-set! a #(a b c) 1)) (array-equal? a #2((1 2 3) (a b c)))))) (pass-if "array III" (let ((a (list->array 2 '((1 2 3) (4 5 6))))) - (and (eq? a (array-amend! a #2((a b c) (x y z)))) + (and (eq? a (array-cell-set! a #2((a b c) (x y z)))) (array-equal? a #2((a b c) (x y z)))))) (pass-if "rank 0 array" (let ((a (make-array 77))) - (and (eq? a (array-amend! a 99)) + (and (eq? a (array-cell-set! a 99)) (array-equal? a #0(99)))))) |