Random Bits of Open Code

Check-in [a853d9731e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:added tests for mtconfigf
Timelines: family | ancestors | descendants | both | modularize-debug
Files: files | file ages | folders
SHA1:a853d9731ee1bed2d4dc71701ad109bb34dd8e55
User & Date: bjbarcla 2019-01-04 00:59:29
Context
2019-01-04
01:15
put back any? in mtargs check-in: 99148c4a59 user: bjbarcla tags: modularize-debug
00:59
added tests for mtconfigf check-in: a853d9731e user: bjbarcla tags: modularize-debug
00:58
marked margs for deprecation check-in: 99121dd728 user: bjbarcla tags: modularize-debug
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added mtutils/mtconfigf/tests/run.scm.

































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
(load "../mtdebug/mtdebug.scm")
(load "mtconfigf.scm")
(import (prefix mtconfigf config:))
(use test)

(let* ((cfgdat
        (config:read-config "tests/test.config" #f #f)))

  
  (test #f "value" (config:lookup cfgdat "basic" "key"))
  (test #f 2 (config:lookup-number cfgdat "basic" "two"))
  
  )

(config:add-eval-string "(define (customfunc) \"hello\")")
(let* ((cfgdat
        (config:read-config "tests/test2.config" #f #f)))
  (test #f "2" (config:lookup cfgdat "schemy" "addup"))
  (test #f 2 (config:lookup-number cfgdat "schemy" "addup"))
  (test #f "hello" (config:lookup cfgdat "schemy" "custom"))
  )


(let* ((cfgdat
        (config:read-config "tests/test3.config" #f #t)))
  (test #f "hello" (config:lookup cfgdat "systemic" "hello"))
  (test #f
        (conc "hello " (get-environment-variable "USER"))
        (config:lookup cfgdat "systemic" "hellouser"))

  )

Added mtutils/mtconfigf/tests/test.config.







>
>
>
1
2
3
[basic]
key value
two 2

Added mtutils/mtconfigf/tests/test2.config.







>
>
>
1
2
3
[schemy]
addup #{scheme (+ 1 1)}
custom #{scheme (customfunc)}

Added mtutils/mtconfigf/tests/test3.config.







>
>
>
1
2
3
[systemic]
hello [system echo hello]
hellouser [system echo hello $USER]