forked from nodeca/js-yaml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0346.js
25 lines (21 loc) · 750 Bytes
/
0346.js
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
'use strict';
var assert = require('assert');
var yaml = require('../../');
test('should not emit spaces in arrays in flow mode between entries using condenseFlow: true', function () {
var array = [ 'a', 'b' ];
var dumpedArray = yaml.dump(array, { flowLevel: 0, indent: 0, condenseFlow: true });
assert.equal(
dumpedArray,
'[a,b]\n'
);
assert.deepEqual(yaml.load(dumpedArray), array);
});
test('should not emit spaces between key: value and quote keys using condenseFlow: true', function () {
var object = { a: { b: 'c' } };
var objectDump = yaml.dump(object, { flowLevel: 0, indent: 0, condenseFlow: true });
assert.equal(
objectDump,
'{"a":{"b":c}}\n'
);
assert.deepEqual(yaml.load(objectDump), object);
});