mirror of
https://github.com/status-im/nim-confutils.git
synced 2025-02-03 07:43:55 +00:00
27 lines
570 B
Nim
27 lines
570 B
Nim
import
|
|
std/[strutils, unittest],
|
|
../confutils,
|
|
./specialint
|
|
|
|
type
|
|
TestConf* = object
|
|
La1* {.
|
|
desc: "La1"
|
|
name: "la1" }: SInt
|
|
|
|
La2* {.
|
|
desc: "La2"
|
|
name: "la2" }: specialint.SInt
|
|
|
|
proc parseCmdArg(T: type specialint.SInt, p: TaintedString): T =
|
|
parseInt(string p).T
|
|
|
|
proc completeCmdArg(T: type specialint.SInt, val: TaintedString): seq[string] =
|
|
return @[]
|
|
|
|
suite "Qualified Ident":
|
|
test "Qualified Ident":
|
|
let conf = TestConf.load(@["--la1:123", "--la2:456"])
|
|
check conf.La1.int == 123
|
|
check conf.La2.int == 456
|