mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
add vector-move test cases
* test-suite/tests/vectors.test ("vector-move-left!") ("vector-move-right!"): Add test cases for recent bug.
This commit is contained in:
parent
ca65967360
commit
99015f6d4e
1 changed files with 13 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
;;;; vectors.test --- test suite for Guile's vector functions -*- scheme -*-
|
;;;; vectors.test --- test suite for Guile's vector functions -*- scheme -*-
|
||||||
;;;;
|
;;;;
|
||||||
;;;; Copyright (C) 2003, 2006, 2010 Free Software Foundation, Inc.
|
;;;; Copyright (C) 2003, 2006, 2010, 2011 Free Software Foundation, Inc.
|
||||||
;;;;
|
;;;;
|
||||||
;;;; This library is free software; you can redistribute it and/or
|
;;;; This library is free software; you can redistribute it and/or
|
||||||
;;;; modify it under the terms of the GNU Lesser General Public
|
;;;; modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -97,6 +97,12 @@
|
||||||
(vector-move-left! a 3 5 b 7)
|
(vector-move-left! a 3 5 b 7)
|
||||||
(equal? b #(10 20 30 40 50 60 70 4 5))))
|
(equal? b #(10 20 30 40 50 60 70 4 5))))
|
||||||
|
|
||||||
|
(pass-if "whole thing"
|
||||||
|
(let ((a (vector 1 2 3 4 5 6 7 8 9))
|
||||||
|
(b (vector 10 20 30 40 50 60 70 80 90)))
|
||||||
|
(vector-move-left! a 0 9 b 0)
|
||||||
|
(equal? b #(1 2 3 4 5 6 7 8 9))))
|
||||||
|
|
||||||
(pass-if-exception "past end" exception:out-of-range
|
(pass-if-exception "past end" exception:out-of-range
|
||||||
(let ((a (vector 1 2 3 4 5 6 7 8 9))
|
(let ((a (vector 1 2 3 4 5 6 7 8 9))
|
||||||
(b (vector 10 20 30 40 50 60 70 80 90)))
|
(b (vector 10 20 30 40 50 60 70 80 90)))
|
||||||
|
@ -137,6 +143,12 @@
|
||||||
(vector-move-right! a 3 5 b 7)
|
(vector-move-right! a 3 5 b 7)
|
||||||
(equal? b #(10 20 30 40 50 60 70 4 5))))
|
(equal? b #(10 20 30 40 50 60 70 4 5))))
|
||||||
|
|
||||||
|
(pass-if "whole thing"
|
||||||
|
(let ((a (vector 1 2 3 4 5 6 7 8 9))
|
||||||
|
(b (vector 10 20 30 40 50 60 70 80 90)))
|
||||||
|
(vector-move-right! a 0 9 b 0)
|
||||||
|
(equal? b #(1 2 3 4 5 6 7 8 9))))
|
||||||
|
|
||||||
(pass-if-exception "past end" exception:out-of-range
|
(pass-if-exception "past end" exception:out-of-range
|
||||||
(let ((a (vector 1 2 3 4 5 6 7 8 9))
|
(let ((a (vector 1 2 3 4 5 6 7 8 9))
|
||||||
(b (vector 10 20 30 40 50 60 70 80 90)))
|
(b (vector 10 20 30 40 50 60 70 80 90)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue