}
}
+/* Find the hash_table_test object correponding to the (bare) symbol TEST,
+ creating one if none existed. */
static struct hash_table_test *
get_hash_table_user_test (Lisp_Object test)
{
Lisp_Object equal_fn = XCAR (prop);
Lisp_Object hash_fn = XCAR (XCDR (prop));
struct hash_table_user_test *ut = hash_table_user_tests;
- while (ut && !(EQ (equal_fn, ut->test.user_cmp_function)
+ while (ut && !(BASE_EQ (test, ut->test.name)
+ && EQ (equal_fn, ut->test.user_cmp_function)
&& EQ (hash_fn, ut->test.user_hash_function)))
ut = ut->next;
if (!ut)
(should (= (sxhash-equal (record 'a (make-string 10 ?a)))
(sxhash-equal (record 'a (make-string 10 ?a))))))
+(ert-deftest fns--define-hash-table-test ()
+ ;; Check that we can have two differently-named tests using the
+ ;; same functions (bug#68668).
+ (define-hash-table-test 'fns-tests--1 'my-cmp 'my-hash)
+ (define-hash-table-test 'fns-tests--2 'my-cmp 'my-hash)
+ (let ((h1 (make-hash-table :test 'fns-tests--1))
+ (h2 (make-hash-table :test 'fns-tests--2)))
+ (should (eq (hash-table-test h1) 'fns-tests--1))
+ (should (eq (hash-table-test h2) 'fns-tests--2))))
+
(ert-deftest test-secure-hash ()
(should (equal (secure-hash 'md5 "foobar")
"3858f62230ac3c915f300c664312c63f"))