~subsetpark/ec

ref: big ec/test/print.janet -rw-r--r-- 341 bytes
3f9b6ebe — Zach Smith Support bigints (note: this does not work on account of floats being coerced to big ints) 9 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!)