Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(537)

Unified Diff: 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

Issue 800513006: Added vulcanize under third_party/npm_modules (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
new file mode 100644
index 0000000000000000000000000000000000000000..3a05eaf32ef7c04549be4c0ac8f6c451a463027b
--- /dev/null
+++ 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
@@ -0,0 +1,71 @@
+var i = require("../")
+ , tap = require("tap")
+ , test = tap.test
+ , fs = require("fs")
+ , path = require("path")
+ , 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'
+ + '\n'
+ + '[a]\n'
+ + 'av = a val\n'
+ + 'e = { o: p, a: '
+ + '{ av: a val, b: { c: { e: "this [value]" '
+ + '} } } }\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'
+ , expectD =
+ { o: 'p',
+ 'a with spaces': 'b c',
+ " xa n p ":'"\r\nyoyoyo\r\r\n',
+ '[disturbing]': 'hey you never know',
+ 'zr': ['deedee'],
+ 'ar': ['one', 'three', 'this is included'],
+ 'br': 'warm',
+ a:
+ { av: 'a val',
+ e: '{ o: p, a: { av: a val, b: { c: { e: "this [value]" } } } }',
+ j: '"{ o: "p", a: { av: "a val", b: { c: { e: "this [value]" } } } }"',
+ "[]": "a square?",
+ cr: ['four', 'eight'],
+ b: { c: { e: '1', j: '2' } } },
+ 'x.y.z': {
+ 'x.y.z': 'xyz',
+ 'a.b.c': {
+ 'a.b.c': 'abc',
+ 'nocomment': 'this\; this is not a comment'
+ }
+ }
+ }
+
+test("decode from file", function (t) {
+ var d = i.decode(data)
+ t.deepEqual(d, expectD)
+ t.end()
+})
+
+test("encode from data", function (t) {
+ var e = i.encode(expectD)
+ t.deepEqual(e, expectE)
+
+ var obj = {log: { type:'file', level: {label:'debug', value:10} } }
+ e = i.encode(obj)
+ t.notEqual(e.slice(0, 1), '\n', 'Never a blank first line')
+ t.notEqual(e.slice(-2), '\n\n', 'Never a blank final line')
+
+ t.end()
+})

Powered by Google App Engine
This is Rietveld 408576698