aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--annexview-tests.el54
1 files changed, 28 insertions, 26 deletions
diff --git a/annexview-tests.el b/annexview-tests.el
index b4ad4e6..3770a4c 100644
--- a/annexview-tests.el
+++ b/annexview-tests.el
@@ -169,29 +169,31 @@
(ert-deftest annexview-views ()
(annexview-with-test-repo
- (annexview-create-view (list "year=*"))
- (should (file-exists-p "2017"))
- (should (file-exists-p "2018"))
- ;; vpop
- (annexview-vpop)
- (should-not (file-exists-p "2017"))
- (should-not (file-exists-p "2018"))
- ;; vcycle
- (annexview-create-view (list "tag=*" "year=*"))
- (should (equal (annexview-string-sort (annexview-views))
- (list "tag=_;year=_" "year=_")))
- (should (file-exists-p "foo-tag0"))
- (should (file-exists-p "foo-tag1"))
- (annexview-vcycle)
- (should (file-exists-p "2017"))
- (should (file-exists-p "2017/foo-tag0"))
- ;; vfilter
- (annexview-create-view (list "year=*"))
- (annexview-vfilter (list "tag=foo-tag0"))
- (should (file-exists-p "2017"))
- (should-not (file-exists-p "2018"))
- ;; vadd
- (annexview-create-view (list "tag=*"))
- (annexview-vadd (list "year=*"))
- (should (file-exists-p "2017"))
- (should (file-exists-p "2017/foo-tag0"))))
+ (let ((base (annexview-git-string "symbolic-ref" "--short" "HEAD")))
+ (annexview-create-view (list "year=*"))
+ (should (file-exists-p "2017"))
+ (should (file-exists-p "2018"))
+ ;; vpop
+ (annexview-vpop)
+ (should-not (file-exists-p "2017"))
+ (should-not (file-exists-p "2018"))
+ ;; vcycle
+ (annexview-create-view (list "tag=*" "year=*"))
+ (should (equal (annexview-string-sort (annexview-views))
+ (mapcar (lambda (v) (concat base "(" v ")"))
+ (list "tag=_;year=_" "year=_"))))
+ (should (file-exists-p "foo-tag0"))
+ (should (file-exists-p "foo-tag1"))
+ (annexview-vcycle)
+ (should (file-exists-p "2017"))
+ (should (file-exists-p "2017/foo-tag0"))
+ ;; vfilter
+ (annexview-create-view (list "year=*"))
+ (annexview-vfilter (list "tag=foo-tag0"))
+ (should (file-exists-p "2017"))
+ (should-not (file-exists-p "2018"))
+ ;; vadd
+ (annexview-create-view (list "tag=*"))
+ (annexview-vadd (list "year=*"))
+ (should (file-exists-p "2017"))
+ (should (file-exists-p "2017/foo-tag0")))))