summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-03-06 17:17:41 +0100
committerLudovic Courtès <ludo@gnu.org>2020-03-06 17:17:41 +0100
commit5d96e421586fa93d6d110c7c139ed6abd158e6e4 (patch)
tree4d90de79bbc19072584bae6e0ab2b743473ee9c7
parentc5d3b45c9f903cc9726b4bd7e3c13db56bafd587 (diff)
downloadguile-5d96e421586fa93d6d110c7c139ed6abd158e6e4.tar.gz
Add 'hash' test for keywords.
This is a followup to 8b3cad618314f02ad3921fa104f17ca0f721dfcb. * test-suite/tests/hash.test ("hash")["keyword"]: New test prefix.
-rw-r--r--test-suite/tests/hash.test12
1 files changed, 11 insertions, 1 deletions
diff --git a/test-suite/tests/hash.test b/test-suite/tests/hash.test
index 4c21d7129..779043c9a 100644
--- a/test-suite/tests/hash.test
+++ b/test-suite/tests/hash.test
@@ -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)