[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 02/02: Add 'hash' test for keywords.
From: |
Ludovic Courtès |
Subject: |
[Guile-commits] 02/02: Add 'hash' test for keywords. |
Date: |
Fri, 6 Mar 2020 11:18:54 -0500 (EST) |
civodul pushed a commit to branch master
in repository guile.
commit 5d96e421586fa93d6d110c7c139ed6abd158e6e4
Author: Ludovic Courtès <address@hidden>
AuthorDate: Fri Mar 6 17:17:41 2020 +0100
Add 'hash' test for keywords.
This is a followup to 8b3cad618314f02ad3921fa104f17ca0f721dfcb.
* test-suite/tests/hash.test ("hash")["keyword"]: New test prefix.
---
test-suite/tests/hash.test | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/test-suite/tests/hash.test b/test-suite/tests/hash.test
index 4c21d71..779043c 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)