File: quoted.test.js

package info (click to toggle)
node-carto 0.9.5-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, sid, stretch
  • size: 2,272 kB
  • ctags: 329
  • sloc: xml: 189; makefile: 22
file content (23 lines) | stat: -rw-r--r-- 870 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var assert = require('assert');
var tree = require('../lib/carto/tree.js');
require('../lib/carto/tree/quoted');

describe('Quoted', function() {
    describe('basic functionality', function() {
        it('should be constructed', function() {
            var f = new tree.Quoted("Tom's & \"<quoted>\"");
            assert.ok(f);
            assert.equal(f.is, 'string');
        });
        it('should produce normal output', function() {
            var f = new tree.Quoted("Tom's & \"<quoted>\"");
            assert.ok(f);
            assert.equal(f.toString(), "Tom's & \"<quoted>\"");
        });
        it('should produce xml-friendly output', function() {
            var f = new tree.Quoted("Tom's & \"<quoted>\"");
            assert.ok(f);
            assert.equal(f.toString(true), "'Tom&apos;s &amp; &quot;&lt;quoted&gt;&quot;'");
        });
    });
});