Commits

David Krentzlin committed 562f40c

removed match-string as this is now part of missbehave

Comments (0)

Files changed (1)

tests/markov-spec.scm

 (load "../markov-impl.scm")
+(use missbehave-stubs)
 (require-extension (except vandusen $))
 (use srfi-1 format random-bsd srfi-69)
 
 
 
 
-(define (match-string what #!key (with-matches #f))
-  (let ((missmatch #f))
-    (make-matcher
-     check: (lambda (subject)
-              (if with-matches
-                  (let ((matches (irregex-match (force subject) what)))
-                    (call-with-current-continuation
-                     (lambda (return)
-                       (for-each
-                        (lambda (submatch)
-                          (unless matches
-                            (return #f))
-                          (unless (and  (irregex-match-valid-index? matches (car submatch))
-                                        (equal? (irregex-match-substring matches (car submatch)) (cdr submatch)))
-                            (set! missmatch submatch)
 
-                            (return #f)))
-                        with-matches)
-                       #t)))
-                  (irregex-match (force subject) what)))
-     failure-message-generator: (lambda (form subject negate)
-                                  (if with-matches
-                                      (if missmatch
-                                          (if negate
-                                              (sprintf "Expected ~A not to include submatch ~A when matched against ~S" form missmatch what)
-                                              (sprintf "Expected ~A to include submatch ~A when matched against ~S" form missmatch what))
-                                          (if negate
-                                              (sprintf "Exepcted ~A not to match ~S" form what)
-                                              (sprintf "Expected ~A to match ~S" form what)))
-                                      (if negate
-                                          (sprintf "Expected ~A not to match ~S" form what)
-                                          (sprintf "Expected ~A to match ~S" form what)))))))