|
|
@@ -3,7 +3,6 @@
|
|
|
[frontend.util.text :as text-util]))
|
|
|
|
|
|
(deftest test-add-timestamp
|
|
|
- []
|
|
|
(are [x y] (= x y)
|
|
|
(text-util/add-timestamp "LATER hello world\nhello"
|
|
|
"scheduled"
|
|
|
@@ -21,7 +20,6 @@
|
|
|
"LATER hello world\nSCHEDULED: <2021-08-25 Wed>\nfoo:: bar\ntest"))
|
|
|
|
|
|
(deftest get-string-all-indexes
|
|
|
- []
|
|
|
(are [x y] (= x y)
|
|
|
(text-util/get-string-all-indexes "[[hello]] [[world]]" "[[" {})
|
|
|
[0 10]
|
|
|
@@ -31,7 +29,7 @@
|
|
|
|
|
|
(text-util/get-string-all-indexes "a.c a.c ab" "a." {})
|
|
|
[0 4]
|
|
|
-
|
|
|
+
|
|
|
(text-util/get-string-all-indexes "abc" "" { :before? true })
|
|
|
[0]
|
|
|
|
|
|
@@ -40,7 +38,6 @@
|
|
|
))
|
|
|
|
|
|
(deftest test-wrapped-by
|
|
|
- []
|
|
|
(are [x y] (= x y)
|
|
|
'(false false true false false)
|
|
|
(map #(text-util/wrapped-by? "[[]]" % "[[" "]]") (take 5 (range)))
|
|
|
@@ -60,7 +57,6 @@
|
|
|
|
|
|
|
|
|
(deftest test-cut-by
|
|
|
- []
|
|
|
(are [x y] (= x y)
|
|
|
["" "" ""]
|
|
|
(text-util/cut-by "[[]]" "[[" "]]")
|
|
|
@@ -88,6 +84,6 @@
|
|
|
|
|
|
["" "content" ""]
|
|
|
(text-util/cut-by "$pfts>$content$pfts<$" "$pfts>$" "$pfts<$")
|
|
|
-
|
|
|
+
|
|
|
["" "content$p" nil]
|
|
|
(text-util/cut-by "$pfts>$content$p" "$pfts>$" "$pfts<$")))
|