~subsetpark/ec

ref: 44a6ba6184d2b3db8c8fe52700f7952781706c9e ec/test/print.janet -rw-r--r-- 341 bytes
44a6ba61 — Zach Smith Some cleanup around truncate 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
(import /src/print)

(use testament)
(use /test-support)

(deftest truncate
  (is (= "(...)" (print/truncate "(xxxx)" 5)))
  (is (= "[...]" (print/truncate "[xxxx]" 5)))
  (is (= "xxxxxx" (print/truncate "xxxxxx" 5)))

  (is (= "xxx (...)" (print/truncate "xxx (xxxxx)" 10)))
  (is (= "xxx (x)" (print/truncate "xxx (x)" 5))))

(run-tests!)