log5scm / tests / run.scm

;; 
;; Author: David Krentzlin
;; 
;; Created: So Aug  8 18:46:54 2010 (CEST)
;; Last-Updated: Fr Nov 19 10:43:54 2010 (CET)
;;           By: David Krentzlin


(use test)

(load "../log5scm.scm")

(import log5scm)

(test-group "categories"
            (test "Expansion: does work"
                  '(and cat5 (or cat1 cat2))
                  (parameterize ((*defined-categories* (make-hash-table)))
                    (define-category cat3 (or cat1 cat2))
                    (define-category cat4 (and cat5 cat3))
                    (expand-category-spec 'cat4)))
            (test "Expansion: default logical connective"
                  '(and cat5 (and cat1 cat2))
                  (parameterize ((*defined-categories* (make-hash-table))
                                 (default-logical-connective 'and))
                    (define-category cat3 (cat1 cat2))
                    (define-category cat4 (and cat5 cat3))
                    (expand-category-spec 'cat4)))
            (test "Expansion: (identity) does work"
                  'cat1
                  (parameterize ((*defined-categories* (make-hash-table)))
                    (expand-category-spec 'cat1)))


;            (test "Match: Simple" #t #f)
;            (test "Match: Complex" #t #f)
;            (test "Match: Negated" #t #f)


            )

(test-group "senders")

(test-group "output")

(test-group "context"
            (test "push context"
                  (list "test")
                  (parameterize ((active-contexts '()))
                    (push-context "test")
                    (active-contexts)))

            (test "pop context"
                  (list)
                  (parameterize ((active-contexts '()))
                    (push-context "test")
                    (pop-context)
                    (active-contexts)))

            (test "access current context"
                  "test"
                  (parameterize ((active-contexts '()))
                    (push-context "test")
                    (current-context)))
            
            )

(test-group "integration")

(unless (zero? (test-failure-count)) (exit 1))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.