forked from nodeca/js-yaml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dumper noCompatMode option which bypass DEPRECATED_BOOLEANS_SYNTA…
…X handling
- Loading branch information
Showing
4 changed files
with
35 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
|
||
var assert = require('assert'); | ||
var yaml = require('../../'); | ||
|
||
|
||
var DEPRECATED_BOOLEANS_SYNTAX = [ | ||
'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', | ||
'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' | ||
]; | ||
|
||
|
||
test('Dumper should not take into account booleans syntax from YAML 1.0/1.1 in noCompatMode', function () { | ||
DEPRECATED_BOOLEANS_SYNTAX.forEach(function (string) { | ||
var dump = yaml.dump(string, { noCompatMode: true }).trim(); | ||
|
||
assert((dump === string), | ||
('"' + string + '" string is not dumped as-is; actual dump: ' + dump)); | ||
}); | ||
}); |