1
Fork 0
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:
Andy Wingo 2011-02-14 20:21:04 +01:00
parent ca65967360
commit 99015f6d4e

View file

@ -1,6 +1,6 @@
;;;; 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
;;;; modify it under the terms of the GNU Lesser General Public
@ -97,6 +97,12 @@
(vector-move-left! a 3 5 b 7)
(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
(let ((a (vector 1 2 3 4 5 6 7 8 9))
(b (vector 10 20 30 40 50 60 70 80 90)))
@ -137,6 +143,12 @@
(vector-move-right! a 3 5 b 7)
(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
(let ((a (vector 1 2 3 4 5 6 7 8 9))
(b (vector 10 20 30 40 50 60 70 80 90)))