1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-27 21:40:34 +02:00

Merge remote-tracking branch 'local-2.0/stable-2.0'

This commit is contained in:
Andy Wingo 2011-06-16 20:01:56 +02:00
commit 99cc1092a8
115 changed files with 4810 additions and 1543 deletions

View file

@ -1,5 +1,5 @@
;;;; sort.test --- tests Guile's sort functions -*- scheme -*-
;;;; Copyright (C) 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
;;;; Copyright (C) 2003, 2006, 2007, 2009, 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
@ -73,5 +73,10 @@
;; in guile 1.8.0 and 1.8.1 this test failed, an empty list provoked a
;; wrong-type-arg exception (where it shouldn't)
(pass-if "empty list"
(eq? '() (stable-sort '() <))))
(eq? '() (stable-sort '() <)))
;; Ditto here, but up to 2.0.1 and 2.1.0 and invoking undefined
;; behavior (integer underflow) leading to crashes.
(pass-if "empty vector"
(equal? '#() (stable-sort '#() <))))

View file

@ -1,5 +1,5 @@
;;;; weaks.test --- tests guile's weaks -*- scheme -*-
;;;; Copyright (C) 1999, 2001, 2003, 2006, 2009, 2010 Free Software Foundation, Inc.
;;;; Copyright (C) 1999, 2001, 2003, 2006, 2009, 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
@ -208,6 +208,30 @@
(hash-ref z test-key)
#t))))
(pass-if "hash-set!, weak val, im -> im"
(let ((t (make-weak-value-hash-table)))
(hash-set! t "foo" 1)
(hash-set! t "foo" 2)
(equal? (hash-ref t "foo") 2)))
(pass-if "hash-set!, weak val, im -> nim"
(let ((t (make-weak-value-hash-table)))
(hash-set! t "foo" 1)
(hash-set! t "foo" "baz")
(equal? (hash-ref t "foo") "baz")))
(pass-if "hash-set!, weak val, nim -> nim"
(let ((t (make-weak-value-hash-table)))
(hash-set! t "foo" "bar")
(hash-set! t "foo" "baz")
(equal? (hash-ref t "foo") "baz")))
(pass-if "hash-set!, weak val, nim -> im"
(let ((t (make-weak-value-hash-table)))
(hash-set! t "foo" "bar")
(hash-set! t "foo" 1)
(equal? (hash-ref t "foo") 1)))
(pass-if "assoc can do anything"
;; Until 1.9.12, as hash table's custom ASSOC procedure was
;; called with the GC lock alloc held, which imposed severe