changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/lib/vc/tests.lisp

changeset 325: 9b573fc6bc40
parent: 1c6e8353a855
child: 95b861dff3d8
author: Richard Westhaver <ellis@rwest.io>
date: Fri, 10 May 2024 19:33:40 -0400
permissions: -rw-r--r--
description: vc updates, fixed missing in-package lines, skel errors
1 (defpackage :vc/tests
2  (:use :cl :rt :vc))
3 
4 (in-package :vc/tests)
5 (defsuite :vc)
6 (in-suite :vc)
7 (defmacro with-temp-repo (kind &body body)
8  `(let ((repo ,(make-instance 'vc::vc-repo)))
9  (setf (vc::vc-repo-path repo) (merge-pathnames (format nil "~A" (gensym "repo")) "/tmp/"))
10  (case ,kind
11  (:hg (sb-mop::change-class repo 'hg-repo))
12  (:git (sb-mop::change-class repo 'git-repo))
13  (t nil))
14  (vc-init repo)
15  (let ((*default-pathname-defaults* (vc::vc-repo-path repo)))
16  ,@body)))
17 
18 (deftest git ()
19  (with-temp-repo :git
20  (is (streamp (sb-ext:process-output (run-git-command "status" nil :stream))))))
21 
22 (deftest hg ()
23  (with-temp-repo :hg
24  (is (streamp (sb-ext:process-output (run-hg-command "status" nil :stream))))))