~hkdb/geary/disco

« back to all changes in this revision

Viewing changes to test/engine/util-js-test.vala

  • Committer: hkdb
  • Date: 2019-09-26 19:40:48 UTC
  • Revision ID: hkdb@3df.io-20190926194048-n0vggm3yfo8p1ubr
Tags: upstream-3.32.2-disco
Import upstream version 3.32.2-disco

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2017 Michael Gratton <mike@vee.net>
 
3
 *
 
4
 * This software is licensed under the GNU Lesser General Public License
 
5
 * (version 2.1 or later). See the COPYING file in this distribution.
 
6
 */
 
7
 
 
8
public class Geary.JS.Test : TestCase {
 
9
 
 
10
    public Test() {
 
11
        base("Geary.JS.Test");
 
12
        add_test("escape_string", escape_string);
 
13
    }
 
14
 
 
15
    public void escape_string() throws Error {
 
16
        assert(Geary.JS.escape_string("\n") == """\n""");
 
17
        assert(Geary.JS.escape_string("\r") == """\r""");
 
18
        assert(Geary.JS.escape_string("\t") == """\t""");
 
19
        assert(Geary.JS.escape_string("\'") == """\'""");
 
20
        assert(Geary.JS.escape_string("\"") == """\"""");
 
21
 
 
22
        assert(Geary.JS.escape_string("something…\n") == """something…\n""");
 
23
    }
 
24
}