52b818db84de16e3a3f268ee16cf72bbdfefc5c6
[umlisp.git] / -orf / tests / parse.lisp
1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10; Package: umlisp -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
4 ;;;;
5 ;;;; Name:          parse.lisp
6 ;;;; Purpose:       Parsing tests for UMLisp
7 ;;;; Author:        Kevin M. Rosenberg
8 ;;;; Date Started:  May 2003
9 ;;;;
10 ;;;; $Id$
11 ;;;;
12 ;;;; This file, part of UMLisp, is
13 ;;;;    Copyright (c) 2000-2002 by Kevin M. Rosenberg, M.D.
14 ;;;;
15 ;;;; UMLisp users are granted the rights to distribute and use this software
16 ;;;; as governed by the terms of the GNU General Public License.
17 ;;;; *************************************************************************
18
19 (in-package #:umlisp-tests)
20
21 (eval-when (:compile-toplevel :load-toplevel :execute)
22   (if (probe-file (umlisp::umls-pathname "MRFILES"))
23     (pushnew :umls-files cl:*features*)
24     (format t "~&Skipping tests based on UMLS distribution~%")))
25
26 (import '(umlisp::*umls-files* umlisp::*umls-cols*))
27
28 #+umls-files
29 (progn
30   (umlisp::ensure-ucols+ufiles)
31   (deftest uparse.1 (length *umls-files*) 52)
32   (deftest uparse.2 (length *umls-cols*) 327)
33   (deftest uparse.3
34       (sort (mapcar #'u::col (umlisp::ucols (umlisp::find-ufile "MRCON")))
35             #'string<)
36     ("CUI" "KCUILRL" "KCUILUI" "KCUISUI" "KLUILRL" "KPFSTR" "LAT" "LRL" "LUI" "STR"
37                "STT" "SUI" "TS"))
38   (deftest uparse.4
39       (sort (umlisp::fields (umlisp::find-ufile "MRCON"))
40             #'string<)
41     ("CUI" "KCUILRL" "KCUILUI" "KCUISUI" "KLUILRL" "KPFSTR" "LAT" "LRL" "LUI" "STR"
42            "STT" "SUI" "TS"))
43   (deftest uparse.5
44       (sort
45        (umlisp::custom-colnames-for-filename "MRCON")
46        #'string<)
47     ("KCUILRL" "KCUILUI" "KCUISUI" "KLUILRL" "KPFSTR"))
48   (deftest uparse.6
49       (compiled-function-p
50        (umlisp::custom-value-fun
51         (umlisp::find-ucol "KCUISUI" "MRCON")))
52     t)
53   ) ;; umls-files
54
55 #+umls-files
56 (setq cl:*features* (delete :umls-files cl:*features*))
57