diff options
Diffstat (limited to 'test/dompa')
| -rw-r--r-- | test/dompa/coordinates_test.cljc | 32 |
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 |
