diff options
author | Daniel Llorens <lloda@sarc.name> | 2021-08-17 16:47:04 +0200 |
---|---|---|
committer | Daniel Llorens <lloda@sarc.name> | 2021-08-17 16:47:04 +0200 |
commit | 9a62f7cacaf730fca07f6cfd400a1893c2c2acb6 (patch) | |
tree | 47af3f85a9adc4703da274c771e893c4b73ee3ae /test-suite | |
parent | 926f70f9b589eaa43e9b066e8cdd58e0d67435ed (diff) | |
download | guile-9a62f7cacaf730fca07f6cfd400a1893c2c2acb6.tar.gz |
Extend bytevector-fill! to handle a partial fill
* libguile/bytevectors.c (bytevector-fill!): As stated.
(scm_bytevector_fill_x): Stub to avoid changing the C API.
* doc/ref/api-data.texi: Documentation.
* libguile/vectors.c (vector-fill!): Less confusing variable names.
* test-suite/tests/bytevectors.test: Test partial fill cases for
bytevector-fill!.
Diffstat (limited to 'test-suite')
-rw-r--r-- | test-suite/tests/bytevectors.test | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test-suite/tests/bytevectors.test b/test-suite/tests/bytevectors.test index 9ae040f1e..732aadb3e 100644 --- a/test-suite/tests/bytevectors.test +++ b/test-suite/tests/bytevectors.test @@ -65,6 +65,20 @@ (bytevector-fill! bv -128) bv)) + ;; This is a Guile-specific extension. + (pass-if-equal "bytevector-fill! range arguments I" + #vu8(0 0 1 1 1) + (let ((bv (make-bytevector 5 0))) + (bytevector-fill! bv 1 2) + bv)) + + ;; This is a Guile-specific extension. + (pass-if-equal "bytevector-fill! range arguments II" + #vu8(0 0 1 1 0) + (let ((bv (make-bytevector 5 0))) + (bytevector-fill! bv 1 2 4) + bv)) + (pass-if "bytevector-copy! overlapping" ;; See <http://debbugs.gnu.org/10070>. (let ((b (u8-list->bytevector '(1 2 3 4 5 6 7 8)))) |