summaryrefslogtreecommitdiff
path: root/test/dompa/coordinates_test.cljc
diff options
context:
space:
mode:
authorAsko Nõmm <asko@nmm.ee>2025-09-14 18:04:31 +0300
committerAsko Nõmm <asko@nmm.ee>2025-09-14 18:04:31 +0300
commit7062dcc7d32b9a639ec242ee60e0c2daeb4f1552 (patch)
treeaf1706bf291d662863e57c683d6b1532f43e372b /test/dompa/coordinates_test.cljc
parented2cf33c61816d6dd41cd2133ebcf0aa62a28e01 (diff)
Improve tests
Diffstat (limited to 'test/dompa/coordinates_test.cljc')
-rw-r--r--test/dompa/coordinates_test.cljc32
1 files changed, 23 insertions, 9 deletions
diff --git a/test/dompa/coordinates_test.cljc b/test/dompa/coordinates_test.cljc
index 42543b4..a827968 100644
--- a/test/dompa/coordinates_test.cljc
+++ b/test/dompa/coordinates_test.cljc
@@ -3,15 +3,29 @@
[dompa.coordinates :as coordinates]))
(deftest compose-test
- (testing "Create first-pass coordinates"
- (is (= [[0 4] [5 9] [10 15]] (coordinates/compose "<div>hello</div>"))))
+ (testing "Create coordinates"
+ (is (= [[0 4] [5 9] [10 15]]
+ (coordinates/compose "<div>hello</div>"))))
- (testing "Create first-pass coordinates with invalid HTML"
- (is (= [[0 4] [5 9]] (coordinates/compose "<div>hello")))
- (is (= [] (coordinates/compose "<div"))))
+ (testing "Create coordinates with invalid HTML"
+ (is (= [[0 4] [5 9]]
+ (coordinates/compose "<div>hello")))
- (testing "Create first-pass coordinates with just text"
- (is (= [[0 4]] (coordinates/compose "hello"))))
+ (is (= []
+ (coordinates/compose "<div")))
- (testing "Create first-pass coordinates with text starting"
- (is (= [[0 4] [5 9] [10 15]] (coordinates/compose "hello<div></div>"))))) \ No newline at end of file
+ (is (= [[0 3]]
+ (coordinates/compose "div>")))
+
+ (is (= [[0 1]]
+ (coordinates/compose "<>"))))
+
+ (testing "Create coordinates with just text"
+ (is (= [[0 4]]
+ (coordinates/compose "hello"))))
+
+ (testing "Create coordinates with text starting"
+ (is (= [[0 4] [5 9] [10 15]]
+ (coordinates/compose "hello<div></div>")))))
+
+(deftest unify-test) \ No newline at end of file