fix: /scheduled doesn't work well if the content has extra spaces

at the end.
This commit is contained in:
Tienson Qin
2021-08-25 17:37:03 +08:00
parent a7355bb0c3
commit 7d85770a10
3 changed files with 39 additions and 15 deletions

View File

@@ -83,4 +83,22 @@
"**foobar" "foobar"
"*********************foobar" "foobar")))
(deftest test-add-timestamp
[]
(are [x y] (= x y)
(text/add-timestamp "LATER hello world\nhello"
"scheduled"
"<2021-08-25 Wed>")
"LATER hello world\nSCHEDULED: <2021-08-25 Wed>\nhello"
(text/add-timestamp "LATER hello world "
"scheduled"
"<2021-08-25 Wed>")
"LATER hello world\nSCHEDULED: <2021-08-25 Wed>"
(text/add-timestamp "LATER hello world\nfoo:: bar\ntest"
"scheduled"
"<2021-08-25 Wed>")
"LATER hello world\nSCHEDULED: <2021-08-25 Wed>\nfoo:: bar\ntest"))
#_(cljs.test/test-ns 'frontend.text-test)