Mercurial > hg > xemacs-beta
annotate tests/automated/database-tests.el @ 4904:e91e3e353805
Don't compare the same octet with itself if checking for boyer_moore_ok
src/ChangeLog addition:
2010-01-31 Aidan Kehoe <kehoea@parhasard.net>
* search.c (search_buffer):
When checking the octets of c for identity, don't compare the
same octet with itself. Thank you Ben Wing!
tests/ChangeLog addition:
2010-01-31 Aidan Kehoe <kehoea@parhasard.net>
* automated/search-tests.el:
Check that multidimensional characters with repeated octets and
case information force simple_search(), since boyer_moore()
doesn't understand them when constructing its stride table.
In passing; correct my spelling.
* automated/case-tests.el (uni-mappings):
In passing; delete a couple of redundant tests, correct the logic
of another.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 31 Jan 2010 18:09:57 +0000 |
parents | 189fb67ca31a |
children | 0f66906b6e37 |
rev | line source |
---|---|
428 | 1 ;; Copyright (C) 1998 Free Software Foundation, Inc. |
2 | |
3 ;; Author: Martin Buchholz <martin@xemacs.org> | |
4 ;; Maintainer: Martin Buchholz <martin@xemacs.org> | |
5 ;; Created: 1998 | |
6 ;; Keywords: tests, database | |
7 | |
8 ;; This file is part of XEmacs. | |
9 | |
10 ;; XEmacs is free software; you can redistribute it and/or modify it | |
11 ;; under the terms of the GNU General Public License as published by | |
12 ;; the Free Software Foundation; either version 2, or (at your option) | |
13 ;; any later version. | |
14 | |
15 ;; XEmacs is distributed in the hope that it will be useful, but | |
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
18 ;; General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
21 ;; along with XEmacs; see the file COPYING. If not, write to the Free | |
22 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
23 ;; 02111-1307, USA. | |
24 | |
25 ;;; Synched up with: Not in FSF. | |
26 | |
27 ;;; Commentary: | |
28 | |
29 ;;; Test database functionality | |
30 ;;; See test-harness.el | |
31 | |
32 (condition-case nil | |
33 (require 'test-harness) | |
34 (file-error | |
35 (when (and (boundp 'load-file-name) (stringp load-file-name)) | |
36 (push (file-name-directory load-file-name) load-path) | |
37 (require 'test-harness)))) | |
38 | |
39 (flet ((delete-database-files (filename) | |
442 | 40 (dolist (fn (list filename |
41 (concat filename ".db") | |
42 (concat filename ".pag") | |
43 (concat filename ".dir"))) | |
428 | 44 (ignore-file-errors (delete-file fn)))) |
45 | |
46 (test-database (db) | |
47 (Assert (databasep db)) | |
48 (put-database "key1" "val1" db) | |
4855
189fb67ca31a
Create Assert-eq, Assert-equal, etc.
Ben Wing <ben@xemacs.org>
parents:
442
diff
changeset
|
49 (Assert-equal "val1" (get-database "key1" db)) |
428 | 50 (remove-database "key1" db) |
4855
189fb67ca31a
Create Assert-eq, Assert-equal, etc.
Ben Wing <ben@xemacs.org>
parents:
442
diff
changeset
|
51 (Assert-equal nil (get-database "key1" db)) |
428 | 52 (close-database db) |
53 (Assert (not (database-live-p db))) | |
54 (Assert (databasep db)))) | |
55 | |
56 (let ((filename (expand-file-name "test-harness" (temp-directory)))) | |
57 | |
58 (dolist (db-type '(dbm berkeley-db)) | |
59 (when (featurep db-type) | |
60 (princ "\n") | |
61 (delete-database-files filename) | |
62 (test-database (open-database filename db-type)) | |
63 (delete-database-files filename))))) |