File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 (liii config-parser)
33 (liii raw-string)
44 (scheme base)
5- (scheme file)
65) ; import
76
87(check-set-mode! 'report-failed )
3130; ; 文件内容解析规则与 `config-read-string` 一致。
3231; ; 支持注释、多分隔符、DEFAULT section 继承等。
3332
34- ; ; 使用临时文件测试 config-read-file
35- (let ((tmpfile " /tmp/test-config-parser.ini" ))
36- (let ((port (open-output-file tmpfile)))
37- (display " [database]\n host=localhost\n port=5432\n " port)
38- (close-output-port port)
39- ) ; let
40- (let ((config (make-config-parser)))
41- (config-read-file config tmpfile)
42- (check (config-sections config) => ' (" database" ))
43- (check (config-get config " database" " host" ) => " localhost" )
44- (check (config-get config " database" " port" ) => " 5432" )
45- ) ; let
33+ (let ((config (make-config-parser)))
34+ (config-read-file config " tests/liii/config-parser/test-data.ini" )
35+ (check (config-sections config) => ' (" database" ))
36+ (check (config-get config " database" " host" ) => " localhost" )
37+ (check (config-get config " database" " port" ) => " 5432" )
4638) ; let
4739
4840(check-report)
Original file line number Diff line number Diff line change 1+ [database]
2+ host =localhost
3+ port =5432
You can’t perform that action at this time.
0 commit comments