edward

An extensible POSIX-compatible implementation of the ed(1) text editor

git clone https://git.8pit.net/edward.git

 1(import (edward util))
 2
 3(test-group "ports->lines"
 4  (test "multiple"
 5        '(("foo" "bar" "baz") . 12)
 6        (let ((port (open-input-string "foo\nbar\nbaz\n")))
 7          (port->lines port)))
 8
 9  (test "empty"
10        '(() . 0)
11        (let ((port (open-input-string "")))
12          (port->lines port))))
13
14(test-group "count-bytes"
15  (test "ascii string" 6 (count-bytes "foobar"))
16  (test "multibyte string" 2 (count-bytes "λ")))
17
18(test-group "path-join"
19  (test "empty" "" (path-join))
20  (test "single" "foo" (path-join "foo"))
21  (test "multiple" "foo/bar/baz" (path-join "foo" "bar" "baz")))