-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# | ||
# Copyright 2016-2023 by Vinay Sajip. All Rights Reserved. | ||
# | ||
import complex | ||
import os | ||
import strutils | ||
import tables | ||
import times | ||
import typetraits | ||
import unittest | ||
|
||
import ../src/config | ||
|
||
proc dataFilePath(paths: varargs[string]): string = | ||
"tests" / "resources" / paths.join("/") | ||
|
||
# | ||
# Config | ||
# | ||
|
||
proc CV(s: string): ConfigValue = | ||
ConfigValue(kind: StringValue, stringValue: s) | ||
|
||
|
||
test "main config": | ||
var p = dataFilePath("derived", "main.cfg") | ||
var cfg = newConfig() | ||
cfg.includePath.add(dataFilePath("base")) | ||
cfg.loadFile(p) | ||
|
||
var lcfg = cfg.getSubConfig("logging") | ||
var ev = CV("bar") | ||
check ev == lcfg.get("foo.bar", ev) | ||
#ev.stringValue = "bozz" | ||
echo "Before test" | ||
discard parsePath("handlers.debug.lvl") | ||
#check ev == lcfg.get("handlers.debug.lvl", ev) | ||
echo "After test" |