Skip to content

Commit

Permalink
nicely done.
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan-leba committed Nov 23, 2023
1 parent 8145064 commit f9b8209
Show file tree
Hide file tree
Showing 8 changed files with 584 additions and 588 deletions.
2 changes: 1 addition & 1 deletion tests/setup.el
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ executable programs, such as the C/C++ compiler and linker."
(funcall mode)

(treesit-parser-create
(or (alist-get mode tree-edit--test-major-mode-mapping)
(or (alist-get mode tree-edit-language-alist)
(user-error "[test harness] no grammar specified for %s" major-mode))
temp-buffer)

Expand Down
File renamed without changes.
File renamed without changes.
22 changes: 11 additions & 11 deletions tests/test-java.el.x → tests/test-java.el
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
(with-base-test-buffer #'java-mode ""
(let ((evil-tree-state-map (make-sparse-keymap))
(tree-edit-nodes
'((:type if_statement
:key "i"))))
'((java (:type if_statement
:key "i")))))
(define-evil-tree-edit-verb evil-tree-state-map "t" #'dummy-verb)
(evil-tree-state)
(expect (key-binding "ti"))
Expand All @@ -44,7 +44,7 @@
(it "loads grammar"
(with-base-test-buffer #'java-mode "" (expect tree-edit-grammar)))
(it "errors and disables tree-edit-mode on unknown mode"
(expect (with-base-test-buffer #'emacs-lisp-mode "") :to-throw 'error))
(expect (with-base-test-buffer #'fundamental-mode "") :to-throw 'error))

;; TODO
(xit "uses node overrides"))
Expand Down Expand Up @@ -445,14 +445,14 @@ class Main {[void bar() {}]
break;[break;]
}")
;; (expect (with-tree-test-buffer #'java-mode "
;; class Main {[public] void main() {}
;; }"
;; ;; FIXME: Test selects anonymous keyword 'public', instead of 'modifiers
;; (evil-tree-edit-goto-parent)
;; (evil-tree-edit-delete))
;; :to-have-buffer-contents "
;; class Main {[void] main() {}
;; }")
;; class Main {[public] void main() {}
;; }"
;; ;; FIXME: Test selects anonymous keyword 'public', instead of 'modifiers
;; (evil-tree-edit-goto-parent)
;; (evil-tree-edit-delete))
;; :to-have-buffer-contents "
;; class Main {[void] main() {}
;; }")
(expect (with-tree-test-buffer #'java-mode "{foo([x],y);}"
(evil-tree-edit-delete))
:to-have-buffer-contents "{foo([y]);}")
Expand Down
Loading

0 comments on commit f9b8209

Please sign in to comment.