forked from nodeca/js-yaml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0470.js
46 lines (31 loc) · 1.15 KB
/
0470.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
'use strict';
var assert = require('assert');
var yaml = require('../..');
test('should not unnecessaryly apply quotes', function () {
var expected = 'url: https://github.com/nodeca/js-yaml\n';
var actual = yaml.dump(
{
url: 'https://github.com/nodeca/js-yaml'
}
);
assert.strictEqual(actual, expected);
});
test('should not unnecessaryly apply quotes - ', function () {
var expected = 'url: https://github.com/nodeca/js-yaml\n';
var obj = {};
obj['url'] = 'https://github.com/nodeca/js-yaml';
var actual = yaml.dump(obj);
assert.strictEqual(actual, expected);
});
test('should not unnecessaryly apply quotes - space then /\n at end of value', function () {
var expected = 'url: \'https://github.com/nodeca/js-yaml \'\n';
var obj = {};
obj['url'] = 'https://github.com/nodeca/js-yaml ';
var actual = yaml.dump(obj);
assert.strictEqual(actual, expected);
});
test('should not unnecessaryly apply quotes - space after colon', function () {
var expected = 'url: \'https: //github.com/nodeca/js-yaml\'\n';
var actual = yaml.dump({ url: 'https: //github.com/nodeca/js-yaml' });
assert.strictEqual(actual, expected);
});