;;; ase-tests.el -- Tests for ASE ;; Copyright (C) 2006, 2007 Sebastian Freundt ;; ;; Author: Sebastian Freundt ;; Keywords: tests ;; ;; This file is part of SXEmacs. ;; ;; Redistribution and use in source and binary forms, with or without ;; modification, are permitted provided that the following conditions ;; are met: ;; ;; 1. Redistributions of source code must retain the above copyright ;; notice, this list of conditions and the following disclaimer. ;; ;; 2. Redistributions in binary form must reproduce the above copyright ;; notice, this list of conditions and the following disclaimer in the ;; documentation and/or other materials provided with the distribution. ;; ;; 3. Neither the name of the author nor the names of any contributors ;; may be used to endorse or promote products derived from this ;; software without specific prior written permission. ;; ;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR ;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ;; DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE ;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR ;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE ;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN ;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; ;;; Synched up with: Not in FSF. ;;; Commentary: ;; See test-harness.el for instructions on how to run these tests. (eval-when-compile (condition-case nil (require 'test-harness) (file-error (push "." load-path) (when (and (boundp 'load-file-name) (stringp load-file-name)) (push (file-name-directory load-file-name) load-path)) (require 'test-harness)))) ;;;###eval-me-first (and (featurep 'modules) (locate-module "ase-permutation") (require 'ase-permutation)) (when (featurep 'ase-permutation) (Assert ase-identity-permutation) (Assert (ase-permutation [2 3 1])) (Assert (ase-permutation [1 3 2 4 6 5])) ;; testing the read syntax ;; can't test it with test-harness atm, because they read the buffer ;; using #'read which does not allow for changing the scanner+parser ;; while scanning and parsing ;; ;; #p[1 3 2] ;; ;; #p[(1 2) (6 3 7)] ;; #p[(1 2 4) (6 3 7)] ;; #p[(1 2) (6 3 4 5 7)] ;; #p[(1 2 4 5) (6 3 7)] ;; ;; #p[2 4 7 5 1 3 6] ;; #p[(4 5 1 2) (6 3 7)] ;; ;; #p[(1 2 3) (2 4 5)] ) ;; ase-permutation-tests.el ends here