changelog shortlog graph tags branches changeset files revisions annotate raw help

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

changeset 698: 96958d3eb5b0
parent: 328e1ff73938
author: Richard Westhaver <ellis@rwest.io>
date: Fri, 04 Oct 2024 22:04:59 -0400
permissions: -rw-r--r--
description: fixes
1 (defpackage :vc/tests
2  (:use :cl :std :rt :vc/proto :vc/git :vc/hg :vc))
3 
4 (in-package :vc/tests)
5 (defsuite :vc)
6 (in-suite :vc)
7 
8 (defmacro with-temp-repo (kind &body body)
9  `(let ((repo ,(make-repo ".")))
10  (setf (vc-path repo) (merge-pathnames (format nil "~A" (gensym "repo")) "/tmp/"))
11  (case ,kind
12  (:hg (sb-mop::change-class repo 'hg-repo))
13  (:git (sb-mop::change-class repo 'git-repo))
14  (t nil))
15  (vc-init repo)
16  (let ((*default-pathname-defaults* (vc-path repo)))
17  ,@body)))
18 
19 (deftest git ()
20  (with-temp-repo :git
21  (is (streamp (sb-ext:process-output (run-git-command "status" nil :stream))))))
22 
23 (deftest hg ()
24  (with-temp-repo :hg
25  (is (streamp (sb-ext:process-output (run-hg-command "status" nil :stream))))))
26 
27 (deftest vc ()
28  (with-temp-repo (*default-vc-kind*) (is repo)))
29 
30 ;; TODO 2024-08-22:
31 (deftest vc-mirror-update (:skip t)
32  "This test replicates a nushell script we've used for a very long time - 'use
33 vc.nu; vc mirrors update;'"
34  (with-temp-repo :hg
35  (vc-id repo)))