Index: node_modules/vulcanize/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/ini/test/foo.js |
diff --git a/node_modules/vulcanize/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/ini/test/foo.js b/node_modules/vulcanize/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/ini/test/foo.js |
index 3a05eaf32ef7c04549be4c0ac8f6c451a463027b..9d34aa6fdaf37b93d534a3790b8d63cfeb556f31 100644 |
--- a/node_modules/vulcanize/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/ini/test/foo.js |
+++ b/node_modules/vulcanize/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/ini/test/foo.js |
@@ -6,33 +6,40 @@ var i = require("../") |
, fixture = path.resolve(__dirname, "./fixtures/foo.ini") |
, data = fs.readFileSync(fixture, "utf8") |
, d |
- , expectE = 'o = p\n' |
- + 'a with spaces = b c\n' |
- + '" xa n p " = "\\"\\r\\nyoyoyo\\r\\r\\n"\n' |
- + '"[disturbing]" = hey you never know\n' |
- + 'zr[] = deedee\n' |
- + 'ar[] = one\n' |
- + 'ar[] = three\n' |
- + 'ar[] = this is included\n' |
- + 'br = warm\n' |
+ , expectE = 'o=p\n' |
+ + 'a with spaces=b c\n' |
+ + '" xa n p "="\\"\\r\\nyoyoyo\\r\\r\\n"\n' |
+ + '"[disturbing]"=hey you never know\n' |
+ + 's=something\n' |
+ + 's1=\"something\'\n' |
+ + 's2=something else\n' |
+ + 'zr[]=deedee\n' |
+ + 'ar[]=one\n' |
+ + 'ar[]=three\n' |
+ + 'ar[]=this is included\n' |
+ + 'br=warm\n' |
+ '\n' |
+ '[a]\n' |
- + 'av = a val\n' |
- + 'e = { o: p, a: ' |
+ + 'av=a val\n' |
+ + 'e={ o: p, a: ' |
+ '{ av: a val, b: { c: { e: "this [value]" ' |
- + '} } } }\nj = "\\"{ o: \\"p\\", a: { av:' |
+ + '} } } }\nj="\\"{ o: \\"p\\", a: { av:' |
+ ' \\"a val\\", b: { c: { e: \\"this [value]' |
- + '\\" } } } }\\""\n"[]" = a square?\n' |
- + 'cr[] = four\ncr[] = eight\n\n' |
- +'[a.b.c]\ne = 1\n' |
- + 'j = 2\n\n[x\\.y\\.z]\nx.y.z = xyz\n\n' |
- + '[x\\.y\\.z.a\\.b\\.c]\na.b.c = abc\n' |
- + 'nocomment = this\\; this is not a comment\n' |
+ + '\\" } } } }\\""\n"[]"=a square?\n' |
+ + 'cr[]=four\ncr[]=eight\n\n' |
+ +'[a.b.c]\ne=1\n' |
+ + 'j=2\n\n[x\\.y\\.z]\nx.y.z=xyz\n\n' |
+ + '[x\\.y\\.z.a\\.b\\.c]\na.b.c=abc\n' |
+ + 'nocomment=this\\; this is not a comment\n' |
+ + 'noHashComment=this\\# this is not a comment\n' |
, expectD = |
{ o: 'p', |
'a with spaces': 'b c', |
" xa n p ":'"\r\nyoyoyo\r\r\n', |
'[disturbing]': 'hey you never know', |
+ 's': 'something', |
+ 's1' : '\"something\'', |
+ 's2': 'something else', |
'zr': ['deedee'], |
'ar': ['one', 'three', 'this is included'], |
'br': 'warm', |
@@ -47,10 +54,21 @@ var i = require("../") |
'x.y.z': 'xyz', |
'a.b.c': { |
'a.b.c': 'abc', |
- 'nocomment': 'this\; this is not a comment' |
+ 'nocomment': 'this\; this is not a comment', |
+ noHashComment: 'this\# this is not a comment' |
} |
} |
} |
+ , expectF = '[prefix.log]\n' |
+ + 'type=file\n\n' |
+ + '[prefix.log.level]\n' |
+ + 'label=debug\n' |
+ + 'value=10\n' |
+ , expectG = '[log]\n' |
+ + 'type = file\n\n' |
+ + '[log.level]\n' |
+ + 'label = debug\n' |
+ + 'value = 10\n' |
test("decode from file", function (t) { |
var d = i.decode(data) |
@@ -69,3 +87,19 @@ test("encode from data", function (t) { |
t.end() |
}) |
+ |
+test("encode with option", function (t) { |
+ var obj = {log: { type:'file', level: {label:'debug', value:10} } } |
+ e = i.encode(obj, {section: 'prefix'}) |
+ |
+ t.equal(e, expectF) |
+ t.end() |
+}) |
+ |
+test("encode with whitespace", function (t) { |
+ var obj = {log: { type:'file', level: {label:'debug', value:10} } } |
+ e = i.encode(obj, {whitespace: true}) |
+ |
+ t.equal(e, expectG) |
+ t.end() |
+}) |