Initial commit

This commit is contained in:
cælōrum spectātrīx 2025-12-22 20:51:05 +01:00
commit 0529301663
5 changed files with 163 additions and 0 deletions

27
tests/run.scm Normal file
View file

@ -0,0 +1,27 @@
(import (scheme base)
(chicken port)
(srfi-233)
(test))
(test "accumulator"
"[section1]\nkey1ævalue1\nß acomment\nvaluewithnokey\n[section2]\nkey2ævalue2\n"
(call-with-output-string
(lambda (out)
(let ((my-accumulator (make-ini-file-accumulator out #\æ #\ß)))
(for-each my-accumulator
(list (list 'section1 'key1 "value1")
"acomment"
(list 'section1 #f "valuewithnokey")
(list 'section2 'key2 "value2")))))))
(test "generator"
(list (list 'section1 'key1 "value1")
(list 'section1 #f "valuewithnokey")
(list 'section2 'key2 "value2"))
(call-with-input-string
"[section1]\nkey1øvalue1\nđ acomment\nvaluewithnokey\n[section2]\nkey2øvalue2\n"
(lambda (in)
(let ((my-generator (make-ini-file-generator in #\ø #\đ)))
(port-map identity my-generator)))))
(test-exit)