Changeset 21993 in project for release/4/nomads/trunk/tests/run.scm


Ignore:
Timestamp:
12/14/10 21:01:52 (10 years ago)
Author:
certainty
Message:

nomads: irreversible migrations can take an optional message now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/nomads/trunk/tests/run.scm

    r21538 r21993  
    33;;
    44;; Created: Do Nov 11 16:25:19 2010 (CET)
    5 ;; Last-Updated: Do Nov 18 19:36:32 2010 (CET)
     5;; Last-Updated: Di Dez 14 20:41:22 2010 (CET)
    66;;           By:
    77
     
    4444                                (db-latest-version db))))
    4545
    46 (define (test-migration to #!key (reset #f))
     46(define (test-migration to #!key (reset #f) (callback (lambda args #t)))
    4747  (initialize-test-db)
    4848  (if reset (reset-db))
    49   (migrate version: to callback: (lambda args #t))
     49  (migrate version: to callback: callback)
    5050  (latest-version)
    5151  (cons (latest-version) (fetch-versions)))
     
    152152                    (test-migration 'earliest)))
    153153
     154            (test "irreversible migrations with message"
     155                  "Testmessage"
     156                  (parameterize ((migration-directory "./migrations/with-irreversible"))
     157                    (test-migration 'latest reset: #t)
     158                    (let* ((msg "")
     159                           (cb (lambda (checkpoint irreversible? #!optional (message #f))
     160                                 (when irreversible?
     161                                   (set! msg message)))))
     162                      (migrate version:'earliest callback: cb)
     163                      msg)))
     164
    154165
    155166            (test "detect dublicate migrations"
Note: See TracChangeset for help on using the changeset viewer.