Update all unit tests

To meet changes introduced from the straight branch merge.
This commit is contained in:
Henrik Lissner 2019-09-03 00:41:03 -04:00
parent 52b6c51914
commit 059ede53b6
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
20 changed files with 728 additions and 426 deletions

View file

@ -3,12 +3,11 @@
(describe "feature/evil"
:var (resv project-root)
(before-all
(require! :editor evil)
(require 'evil)
(load! "../autoload/evil"))
(after-all
(unload-feature 'evil t))
(require! :editor evil)
(require 'evil)
(load! "../autoload/evil")
(before-each
(fset 'resv #'+evil-resolve-vim-path-a)
(spy-on 'doom-project-root :and-call-fake (lambda () project-root)))

View file

@ -19,33 +19,33 @@
(describe "headlines"
(it "appends first-level headlines with an extra newline"
(insert! "* {0}Header")
(insert!! "* {0}Header")
(+org/insert-item-below 1)
(expect (eobp))
(expect (buffer-substring-no-properties (point-min) (point-max))
:to-equal "* Header\n\n* "))
(it "prepends first-level headlines with an extra newline"
(insert! "* {0}Header")
(insert!! "* {0}Header")
(+org/insert-item-above 1)
(expect (eolp))
(expect (buffer-substring-no-properties (point-min) (point-max))
:to-equal "* \n\n* Header"))
(it "appends second-level headlines with an no extra newline"
(insert! "** {0}Header")
(insert!! "** {0}Header")
(+org/insert-item-below 1)
(expect (eobp))
(expect (buffer-substring-no-properties (point-min) (point-max))
:to-equal "** Header\n** "))
(it "prepends second-level headlines with an no extra newline"
(insert! "** {0}Header")
(insert!! "** {0}Header")
(+org/insert-item-above 1)
(expect (eolp))
(expect (buffer-substring-no-properties (point-min) (point-max))
:to-equal "** \n** Header"))
(it "appends headlines, skipping subtrees"
(insert! "** {0}First\n"
(insert!! "** {0}First\n"
"*** sub 1\n"
"*** sub 2\n"
"**** subsub 1\n"
@ -63,7 +63,7 @@
"** Header")
"\n")))
(it "prepends headlines, skipping subtrees"
(insert! "** First\n"
(insert!! "** First\n"
"*** sub 1\n"
"*** sub 2\n"
"**** {0}subsub 1\n"
@ -83,18 +83,18 @@
(describe "plain lists"
(it "appends items"
(insert! "+ {0}List item")
(insert!! "+ {0}List item")
(+org/insert-item-below 1)
(expect (buffer-substring-no-properties (point-min) (point-max))
:to-equal "+ List item\n+ "))
(it "prepends items"
(insert! "+ {0}List item")
(insert!! "+ {0}List item")
(+org/insert-item-above 1)
(expect (buffer-substring-no-properties (point-min) (point-max))
:to-equal "+ \n+ List item"))
(it "appends items, but skips over child items"
(insert! "+ {0}List item\n"
(insert!! "+ {0}List item\n"
" + Sub item\n"
"+ List item")
(+org/insert-item-below 1)
@ -106,7 +106,7 @@
"+ List item")
"\n")))
(it "prepends items, but skips over child items"
(insert! "+ List item\n"
(insert!! "+ List item\n"
" + Sub item\n"
"+ {0}List item")
(+org/insert-item-above 1)
@ -120,7 +120,7 @@
(describe "numbered lists"
(it "appends items and updates numbers"
(insert! "1. {0}List item\n"
(insert!! "1. {0}List item\n"
"2. Sub item\n"
"3. List item")
(+org/insert-item-below 1)
@ -132,7 +132,7 @@
"4. List item")
"\n")))
(it "prepends items and updates numbers"
(insert! "1. List item\n"
(insert!! "1. List item\n"
"2. Sub item\n"
"3. {0}List item")
(+org/insert-item-above 1)

View file

@ -51,20 +51,20 @@
(describe "css-mode"
(it "converts inline statements into multiline blocks"
(insert! "body { color: red{0}; font-size: 2em; }"))
(insert!! "body { color: red{0}; font-size: 2em; }"))
(it "works when cursor is on closing brace"
(insert! "body { color: red; font-size: 2em; {0}}"))
(insert!! "body { color: red; font-size: 2em; {0}}"))
(it "works when cursor is on opening brace"
(insert! "body {{0} color: red; font-size: 2em; }"))
(insert!! "body {{0} color: red; font-size: 2em; }"))
(it "works when cursor is on same line"
(insert! "{0}body { color: red; font-size: 2em; }"))))
(insert!! "{0}body { color: red; font-size: 2em; }"))))
(describe "comment-indent-new-line"
(before-each
(delay-mode-hooks (scss-mode)))
(it "continues commented lines on newline"
(insert! "// test{0}\n"
(insert!! "// test{0}\n"
"body { color: red; font-size: 2em; }")
(+css/comment-indent-new-line)
(expect (string-trim (buffer-string)) :to-equal
@ -76,7 +76,7 @@
(expect (eolp))
(expect (line-number-at-pos) :to-be 2))
(it "preserves indentation within continued comments"
(insert! "// test{0}\n"
(insert!! "// test{0}\n"
"body { color: red; font-size: 2em; }")
(+css/comment-indent-new-line)
(expect (string-trim (buffer-string)) :to-equal

View file

@ -11,10 +11,11 @@
persp1 persp1-name persp2 persp2-name
wconf)
(require! :ui workspaces)
(require 'persp-mode)
(before-all
(delete-other-windows)
(require! :ui workspaces)
(require 'persp-mode))
(delete-other-windows))
(before-each
(switch-to-buffer "*scratch*")