~subsetpark/ec

ref: 0f5a4a72ac5c34a153a2534fbf32ae55c27109a1 ec/test/print.janet -rw-r--r-- 341 bytes
0f5a4a72 — Zach Smith Regularlize get-shape 1 year, 2 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!)