Removed tests, because they should have been done in git-cli.
This commit is contained in:
+15
-11
@@ -5,11 +5,11 @@
|
|||||||
package-zipper
|
package-zipper
|
||||||
"main.rkt")
|
"main.rkt")
|
||||||
|
|
||||||
(makefile rash-git-cli
|
(makefile 'rash-git-cli
|
||||||
(target all
|
(target 'all
|
||||||
(displayln "make clean, make zip, make status, make sync"))
|
(displayln "make clean, make zip, make status, make sync"))
|
||||||
|
|
||||||
(target clean
|
(target 'clean
|
||||||
(for-each (λ (f) (displayln f) (rm-f f))
|
(for-each (λ (f) (displayln f) (rm-f f))
|
||||||
(list-files "." #px"([.]bak|~)$" #:recursive #t))
|
(list-files "." #px"([.]bak|~)$" #:recursive #t))
|
||||||
(for-each (λ (d) (displayln d) (rm-rf d))
|
(for-each (λ (d) (displayln d) (rm-rf d))
|
||||||
@@ -19,26 +19,30 @@
|
|||||||
(list-files "scribblings" #px"[.](css|js|html)$")))
|
(list-files "scribblings" #px"[.](css|js|html)$")))
|
||||||
)
|
)
|
||||||
|
|
||||||
(target zip
|
(target 'ver
|
||||||
(deps clean)
|
(displayln (git 'next-version))
|
||||||
|
)
|
||||||
|
|
||||||
|
(target 'zip
|
||||||
|
(deps 'clean)
|
||||||
(zip-package #:exclude '(".git" ".gitignore")))
|
(zip-package #:exclude '(".git" ".gitignore")))
|
||||||
|
|
||||||
(target status
|
(target 'status
|
||||||
{
|
{
|
||||||
git status
|
git status
|
||||||
})
|
})
|
||||||
|
|
||||||
(target sync
|
(target 'sync
|
||||||
{
|
{
|
||||||
git status
|
git status
|
||||||
git add -A
|
git add -A
|
||||||
git commit
|
git commit
|
||||||
git push
|
git push
|
||||||
})
|
})
|
||||||
|
|
||||||
(target pull
|
(target 'pull
|
||||||
{
|
{
|
||||||
git pull
|
git pull
|
||||||
})
|
})
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -24,3 +24,10 @@ strings and parenthesized Racket expressions keep their normal Racket meaning.
|
|||||||
|
|
||||||
The package depends on `git-cli`, `rash`, and `linea`. `git-cli` does not
|
The package depends on `git-cli`, `rash`, and `linea`. `git-cli` does not
|
||||||
depend on this package.
|
depend on this package.
|
||||||
|
|
||||||
|
|
||||||
|
## Package tests
|
||||||
|
|
||||||
|
The package tests validate the Rash/Linea binding without invoking an external
|
||||||
|
Git executable. Executable examples are excluded from `raco test --package`;
|
||||||
|
they remain available as examples for interactive use.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
(define collection "rash-git-cli")
|
(define collection "rash-git-cli")
|
||||||
(define pkg-desc "Rash line-mode integration for git-cli")
|
(define pkg-desc "Rash line-mode integration for git-cli")
|
||||||
(define version "0.1.0")
|
(define version "0.1.5")
|
||||||
(define pkg-authors '("Hans Dijkema"))
|
(define pkg-authors '("Hans Dijkema"))
|
||||||
(define license 'MIT)
|
(define license 'MIT)
|
||||||
|
|
||||||
@@ -17,5 +17,9 @@
|
|||||||
"racket-doc"
|
"racket-doc"
|
||||||
"scribble-lib"))
|
"scribble-lib"))
|
||||||
|
|
||||||
|
;; Example programs are executable demonstrations, not package tests.
|
||||||
|
(define test-omit-paths
|
||||||
|
'("examples"))
|
||||||
|
|
||||||
(define scribblings
|
(define scribblings
|
||||||
'(("scribblings/rash-git-cli.scrbl" () ("rash-git-cli"))))
|
'(("scribblings/rash-git-cli.scrbl" () ("rash-git-cli"))))
|
||||||
@@ -35,3 +35,10 @@ Quoted strings and parenthesized Racket expressions retain their normal Racket
|
|||||||
meaning.
|
meaning.
|
||||||
|
|
||||||
The base @tt{git-cli} package has no dependency on Rash, Linea, or this package.
|
The base @tt{git-cli} package has no dependency on Rash, Linea, or this package.
|
||||||
|
|
||||||
|
@section{Testing}
|
||||||
|
|
||||||
|
The package tests verify the Rash/Linea integration without invoking an
|
||||||
|
external Git executable. This keeps the package tests independent of the host
|
||||||
|
operating system, PATH configuration, current directory, and installed Git
|
||||||
|
software.
|
||||||
|
|||||||
+16
-58
@@ -1,64 +1,22 @@
|
|||||||
#lang racket
|
#lang racket
|
||||||
|
|
||||||
(require rackunit
|
(require rackunit
|
||||||
racket/file
|
rash-git-cli
|
||||||
linea/read)
|
(for-syntax racket/base
|
||||||
|
rackunit
|
||||||
|
linea/line-macro-prop))
|
||||||
|
|
||||||
(define tmp (make-temporary-file "rash-git-cli~a" 'directory))
|
;; In Racket expression mode, `git` remains the first-class procedure
|
||||||
|
;; exported by git-cli. Inspecting it must not invoke Git.
|
||||||
|
(check-true (procedure? git))
|
||||||
|
|
||||||
(dynamic-wind
|
;; The same binding must also be marked as a Linea line macro. This verifies
|
||||||
void
|
;; the Rash integration without depending on an external Git executable.
|
||||||
(λ ()
|
(define-syntax (check-git-line-binding stx)
|
||||||
(define module-path (build-path tmp "Rash.rkt"))
|
(define binding
|
||||||
|
(syntax-local-value #'git (λ () #f)))
|
||||||
|
(check-not-false binding)
|
||||||
|
(check-true (line-macro? binding))
|
||||||
|
#'(void))
|
||||||
|
|
||||||
(call-with-output-file module-path
|
(check-git-line-binding)
|
||||||
#:exists 'truncate/replace
|
|
||||||
(λ (out)
|
|
||||||
(displayln "#lang rash" out)
|
|
||||||
(displayln "(require rash-git-cli)" out)))
|
|
||||||
|
|
||||||
(define module-name `(file ,(path->string module-path)))
|
|
||||||
|
|
||||||
(parameterize ([current-directory tmp])
|
|
||||||
(dynamic-require module-name #f))
|
|
||||||
|
|
||||||
(define ns (module->namespace module-name))
|
|
||||||
(parameterize ([current-directory tmp]
|
|
||||||
[current-namespace ns])
|
|
||||||
;; In expression mode the same binding remains callable as git-cli's
|
|
||||||
;; first-class Git procedure.
|
|
||||||
(check-true (eval #'(procedure? git)))
|
|
||||||
|
|
||||||
;; The Rash line form initializes a repository.
|
|
||||||
(define init-line
|
|
||||||
(linea-read-syntax 'drracket-interaction
|
|
||||||
(open-input-string "git init\n")))
|
|
||||||
(eval init-line)
|
|
||||||
(check-true (directory-exists? (build-path tmp ".git")))
|
|
||||||
|
|
||||||
(check-true (eval #'(git 'config 'set! "user.name" "Rash Test")))
|
|
||||||
(check-true (eval #'(git 'config 'set! "user.email" "rash@example.invalid")))
|
|
||||||
|
|
||||||
(call-with-output-file (build-path tmp "test.txt")
|
|
||||||
#:exists 'truncate/replace
|
|
||||||
(λ (out)
|
|
||||||
(displayln "rash" out)))
|
|
||||||
|
|
||||||
(eval
|
|
||||||
(linea-read-syntax 'drracket-interaction
|
|
||||||
(open-input-string "git add test.txt\n")))
|
|
||||||
|
|
||||||
(check-true
|
|
||||||
(eval
|
|
||||||
(linea-read-syntax 'drracket-interaction
|
|
||||||
(open-input-string
|
|
||||||
"git commit -m \"Rash commit\"\n"))))
|
|
||||||
|
|
||||||
(check-equal?
|
|
||||||
(eval
|
|
||||||
(linea-read-syntax 'drracket-interaction
|
|
||||||
(open-input-string "git status\n")))
|
|
||||||
'())
|
|
||||||
(check-equal? (eval #'(git 'status)) '())))
|
|
||||||
(λ ()
|
|
||||||
(delete-directory/files tmp #:must-exist? #f)))
|
|
||||||
|
|||||||
Reference in New Issue
Block a user