~ubuntu-branches/ubuntu/quantal/maas/quantal-updates

« back to all changes in this revision

Viewing changes to src/maasserver/static/jslibs/yui/3.4.1/tests/escape/tests/functional/escape-test.js

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-07-03 17:42:37 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20120703174237-p8l0keuuznfg721k
Tags: 0.1+bzr709+dfsg-0ubuntu1
* New Upstream release
* debian/control:
  - Depends on python-celery, python-tempita, libjs-yui3-{full,min},
    libjs-raphael
* debian/maas.install:
  - Install apiclient, celeryconfig.py, maas-import-pxe-files, preseeds_v2.
  - Update to install various files from chroot, rather tha manually copy
    them from the source.
* debian/maas.links: symlink celeryconfig.py
* debian/maas.maas-celery.upstart: Add job.
* debian/rules:
  - Install celery upstart job.
  - Do not install jslibs as packages are now used.
  - Drop copying of maas_local_settings_sample.py as source now ships
    a maas_local_settings.py
* debian/patches:
  - 04-maas-http-fix.patch: Drop. Merged upstream.
  - 01-fix-database-settings.patch: Refreshed.
  - 99_enums_js.patch: Added until creation of enum.js / build process
    is fixed.
* debian/maas.postinst: Update bzr version to correctly handle upgrades.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
YUI.add('escape-test', function (Y) {
2
 
 
3
 
var Assert = Y.Assert,
4
 
    Escape = Y.Escape;
5
 
 
6
 
Y.Test.Runner.add(new Y.Test.Case({
7
 
    name: 'Escape',
8
 
 
9
 
    'html() should escape HTML characters': function () {
10
 
        Assert.areSame('&amp;&lt;&gt;&quot;&#x27;&#x2F;&#x60;', Escape.html('&<>"\'/`'));
11
 
        Assert.areSame('&amp;&amp;&amp;', Escape.html('&&&'));
12
 
        Assert.areSame('&lt;&lt;&lt;', Escape.html('<<<'));
13
 
        Assert.areSame('&gt;&gt;&gt;', Escape.html('>>>'));
14
 
        Assert.areSame('&quot;&quot;&quot;', Escape.html('"""'));
15
 
        Assert.areSame('&#x27;&#x27;&#x27;', Escape.html("'''"));
16
 
        Assert.areSame('&#x2F;&#x2F;&#x2F;', Escape.html("///"));
17
 
        Assert.areSame('&#x60;&#x60;&#x60;', Escape.html('```'));
18
 
        Assert.areSame('foo', Escape.html('foo'));
19
 
        Assert.areSame('foo &amp; bar', Escape.html('foo & bar'));
20
 
    },
21
 
 
22
 
    'html() should coerce non-strings to strings': function () {
23
 
        Assert.areSame('1', Escape.html(1));
24
 
        Assert.areSame('false', Escape.html(false));
25
 
        Assert.areSame('null', Escape.html(null));
26
 
        Assert.areSame('undefined', Escape.html());
27
 
    },
28
 
 
29
 
    'regex() should escape regular expression characters': function () {
30
 
        Assert.areSame('\\-\\#\\$\\^\\*\\(\\)\\+\\[\\]\\{\\}\\|\\\\\\\,\\.\\?\\ \\\t', Escape.regex('-#$^*()+[]{}|\\,.? \t'));
31
 
        Assert.areSame('\\*\\*\\*', Escape.regex('***'));
32
 
        Assert.areSame('foo', Escape.regex('foo'));
33
 
        Assert.areSame('foo\\-bar', Escape.regex('foo-bar'));
34
 
    },
35
 
 
36
 
    'regex() should coerce non-strings to strings': function () {
37
 
        Assert.areSame('1', Escape.regex(1));
38
 
        Assert.areSame('false', Escape.regex(false));
39
 
        Assert.areSame('null', Escape.regex(null));
40
 
        Assert.areSame('undefined', Escape.regex());
41
 
    },
42
 
 
43
 
    'regexp() should be an alias for regex()': function () {
44
 
        Assert.areSame(Escape.regex, Escape.regexp);
45
 
    }
46
 
}));
47
 
 
48
 
}, '@VERSION@', {requires:['escape', 'test']});