Coverage report: /home/samppa/personal/opiskelu/ohtuprojekti/pulsu/trunk/testdb.lisp

KindCoveredAll%
expression1661 26.2
branch02 0.0
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 (in-package :puls.test)
2
 
3
 (defvar *mock-events* nil)
4
 (defvar *mock-unified* nil)
5
 
6
 (defun load-mock-events ()
7
   (setf *mock-events*
8
         (with-open-file (stream (merge-pathnames "mock-events.sexp"
9
                                                  cl-user::*project-root*))
10
           (read stream))))
11
 
12
 ;; Simulates "select * from plus ... "
13
 (defun mock-get-event (docno event-id)
14
   (find-if (lambda (x)
15
              (and (equal docno (first x))
16
                   (equal event-id (nth 27 x))))
17
            *mock-events*))
18
 
19
 (defun write-mock-events (&optional (how-many? 20))
20
   (let ((file (merge-pathnames "mock-events.sexp"
21
                                cl-user::*project-root*))
22
         (events
23
          (clsql:query
24
           (format nil "select * from plus limit ~A" how-many?))))
25
     (with-open-file (stream file :direction :output
26
                             :if-exists :supersede)
27
       (print events stream))))
28
 
29
 (defun load-mock-unified ()
30
   (setf *mock-unified*
31
         (with-open-file (stream (merge-pathnames "mock-unified.sexp"
32
                                                  cl-user::*project-root*))
33
           (read stream))))
34
 
35
 (defun write-mock-unified ()
36
   (let ((file (merge-pathnames "mock-unified.sexp"
37
                                cl-user::*project-root*))
38
         (events
39
          (puls.ui::get-newest-unified-cases :n 5)))
40
     (with-open-file (stream file :direction :output
41
                             :if-exists :supersede)
42
       (print events stream))))
43