1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00

Add 'hash' test for keywords.

This is a followup to 8b3cad6183.

* test-suite/tests/hash.test ("hash")["keyword"]: New test prefix.
This commit is contained in:
Ludovic Courtès 2020-03-06 17:17:41 +01:00
parent c5d3b45c9f
commit 5d96e42158

View file

@ -1,7 +1,7 @@
;;;; hash.test --- test guile hashing -*- scheme -*-
;;;;
;;;; Copyright (C) 2004, 2005, 2006, 2008, 2011, 2012,
;;;; 2014 Free Software Foundation, Inc.
;;;; 2014, 2020 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
@ -40,6 +40,16 @@
(pass-if (= 0 (hash +nan.0 1)))
(pass-if (= 0 (hash '#() 1)))
(with-test-prefix "keyword"
(pass-if "equality"
(= (hash #:foo most-positive-fixnum)
(hash #:foo most-positive-fixnum)))
(pass-if "inequality"
;; Inequality cannot be 100% guaranteed but should definitely be
;; met for such a case.
(not (= (hash #:foo most-positive-fixnum)
(hash #:bar most-positive-fixnum)))))
(pass-if "cyclic vectors"
(let ()
(define (cyclic-vector n)