Skip to content

Commit 249666a

Browse files
committed
Fix test run
1 parent 1b5b87e commit 249666a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ejc-format.el

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
"Get top position of batch statement(s) seperator `ejc-sql-separator'.
3535
Upper position of this batch statement(s)."
3636
(save-excursion
37+
(when (and (characterp (char-after))
38+
(or (equal (string (char-after)) " ")
39+
(equal (string (char-after)) "\n")))
40+
(forward-char 1))
3741
(if (re-search-backward (ejc-sql-separator-re) nil t nil)
3842
(re-search-forward (ejc-sql-separator-re) nil t nil)
3943
(beginning-of-buffer))

test/ejc-tests.el

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@
116116
23 "SELECT * FROM table / SELECT * FROM user")))
117117
(should (equal '(4 23)
118118
(ejc-test:get-boundaries 3 "\n/\nSELECT * FROM table")))
119-
(should (equal '(1 21)
119+
(should (equal '(1 22)
120120
(ejc-test:get-boundaries 1 "\nSELECT * FROM table\n/")))
121121
(should (equal '(26 44)
122122
(ejc-test:get-boundaries 26 (concat "\n"
123123
"SELECT * FROM table\n"
124124
"/ \n"
125125
"SELECT * FROM user"))))
126-
(should (equal '(1 23)
126+
(should (equal '(1 26)
127127
(ejc-test:get-boundaries 1 "\n SELECT * FROM table\n /")))
128128
(should (equal '(1 23)
129129
(ejc-test:get-boundaries 1 "\n SELECT * FROM table\n / ")))

0 commit comments

Comments
 (0)