forked from nodeca/js-yaml
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yann Savary
committed
Nov 20, 2020
1 parent
d8ba402
commit bfd0fc2
Showing
3 changed files
with
34 additions
and
33 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 was deleted.
Oops, something went wrong.
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,20 @@ | ||
'use strict'; | ||
|
||
|
||
var assert = require('assert'); | ||
var yaml = require('../../'); | ||
|
||
|
||
suite('Should not escape emojis', function () { | ||
test('plain', function () { | ||
assert.strictEqual(yaml.safeDump('😀'), '😀\n'); | ||
}); | ||
|
||
test('escape \\ and " in double-quoted', function () { | ||
assert.strictEqual(yaml.safeDump('\u0007 😀 escape\\ escaper"'), '"\\a 😀 escape\\\\ escaper\\""\n'); | ||
}); | ||
|
||
test('load', function () { | ||
assert.strictEqual(yaml.safeLoad('"\\U0001F600"'), '😀'); | ||
}); | ||
}); |