add path manipulation functions

This commit is contained in:
Ava Apples Affine 2023-03-23 12:07:28 -07:00
parent a711b32730
commit 3b1ae0efd5
Signed by: affine
GPG key ID: 3A4645B8CF806069
3 changed files with 24 additions and 2 deletions

View file

@ -67,6 +67,21 @@
(quote
(not (contains? (1 2 3) 4))))
('get-paths properly splits path into segments'
(quote
(let ((PATH "/seg1:/seg2")
(split-path (get-paths)))
(and (eq? (len split-path) 2)
(contains? split-path "/seg1")
(contains? split-path "/seg2")))))
('add-path properly adds a new path segment to PATH'
(quote
(let ((PATH "/seg1:/seg2")
(new-path "/seg3"))
(add-path new-path)
(contains? (get-paths) new-path))))
;; add more test cases here
))