Initial commit
This commit is contained in:
commit
222808c4bb
7 changed files with 125 additions and 0 deletions
33
tests/run.scm
Normal file
33
tests/run.scm
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
;;; Abbrev library for R7RS Scheme.
|
||||
;;; SPDX-License-Identifier: LicenseRef-OWL-0.9.4
|
||||
;;; SPDX-FileCopyrightText: 2025 afiw <afiw@linuxposting.xyz>
|
||||
(import (abbrev)
|
||||
(test))
|
||||
(test "original example"
|
||||
'(("lisp" . "lisp")
|
||||
("lis" . "lisp")
|
||||
("li" . "lisp")
|
||||
("l" . "lisp")
|
||||
("scala" . "scala")
|
||||
("scal" . "scala")
|
||||
("sca" . "scala")
|
||||
("scheme" . "scheme")
|
||||
("schem" . "scheme")
|
||||
("sche" . "scheme")
|
||||
("sch" . "scheme"))
|
||||
(abbrev '("scheme" "scala" "lisp")))
|
||||
(test "original example with prefix"
|
||||
'(("scala" . "scala")
|
||||
("scal" . "scala")
|
||||
("sca" . "scala")
|
||||
("scheme" . "scheme")
|
||||
("schem" . "scheme")
|
||||
("sche" . "scheme")
|
||||
("sch" . "scheme"))
|
||||
(abbrev '("scheme" "scala" "lisp") "s"))
|
||||
(test-assert "empty list" (null? (abbrev '())))
|
||||
(test "single-element list" '(("c" . "c")) (abbrev '("c")))
|
||||
(test-assert "identical elements" (null? (abbrev '("c" "c"))))
|
||||
(test-error "non-list argument" (abbrev ""))
|
||||
(test-error "non-string element" (abbrev '(())))
|
||||
(test-exit)
|
||||
Loading…
Add table
Add a link
Reference in a new issue