-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrun-tests.el
36 lines (31 loc) · 1.11 KB
/
run-tests.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
(require 'scheme-complete)
(defmacro should-complete (where expected)
`(progn
(goto-char ,where)
(should (equal ,expected
(apply #'try-completion (scheme-get-completions))))))
(ert-deftest sc-test-scheme-base ()
"Tests basic (scheme base) completion"
(scheme-with-find-file "tests/t-albatross.scm"
(should-complete 29 "define")
(should-complete 45 "number->string")
(should-complete 101 "len")
))
(ert-deftest sc-test-scheme-small ()
"Tests other R7RS libraries"
(scheme-with-find-file "tests/t-barracuda.scm"
(should-complete 112 "process-context")
(should-complete 120 "infinite?")
(should-complete 129 "make-rectangular")
(should-complete 134 "open-")
))
(ert-deftest sc-test-string-cursor ()
"Tests disjoint string-cursor"
(scheme-with-find-file "tests/t-coyote.scm"
(should-complete 227 "colon")
(should-complete 229 "len")
(should-complete 237 "len")))
(ert-deftest sc-test-enclosing-2-sexp-prefixes ()
"Tests scheme-enclosing-2-sexp-prefixes bug"
(scheme-with-find-file "tests/t-dolphin.scm"
(should-complete 210 "remainder")))