summaryrefslogtreecommitdiffstats
path: root/kjsembed/tests/test_tdeconfig.js
blob: 519f13fb4e9135d0e2c5757c54319ca5c736e5ff (plain)
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
33
34
35
36
37
38
39
40
#!/usr/bin/env kjscmd

var confName = "jsconfigrc";
var groupName = "Blah";

var conf = new Config(this, confName);

var grp = conf.group();

println( "Group=" + grp );

conf.setGroup(groupName);
conf.writeColorEntry("Test Color", "blue");
conf.writeListEntry("Test Array", ["A Value","B Value", "C Value"]);
conf.writeEntry("Test Text", "this is a test");
conf.sync();

var newData = conf.readListEntry("Test Array");
var newColor = conf.readColorEntry("Test Color");
var newText = conf.readEntry("Test Text");
println("Reread Active Config");
println("Groups: " + conf.groupList());
println(newData);
println(newColor);
println(newText);


var newConf = new Config(this, confName);
println("Reread Saved Config");
println("Groups: " + newConf.groupList());
newConf.setGroup(groupName);

newData = newConf.readListEntry("Test Array");
newColor = newConf.readColorEntry("Test Color", "red");
newText = newConf.readEntry("Test Text", "Wrong Text");

println(newData);
println(newColor);
println(newText);