summaryrefslogtreecommitdiff
path: root/js/test/Slice/macros/Client.js
blob: f8b98496f5354866cbdc4d17bb1735d08d0c4de4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//

(function(module, require, exports)
{
    const Ice = require("ice").Ice;
    const Test = require("Test").Test;
    const TestHelper = require("TestHelper").TestHelper;
    const test = TestHelper.test;

    class Client extends TestHelper
    {
        allTests()
        {
            const out = this.getWriter();
            out.write("testing Slice predefined macros... ");

            const d = new Test._Default();
            test(d.x == 10);
            test(d.y == 10);

            const nd = new Test.NoDefault();
            test(nd.x != 10);
            test(nd.y != 10);

            const c = new Test.JsOnly();
            test(c.lang == "js");
            test(c.version == Ice.intVersion());

            out.writeLine("ok");
        }

        run(args)
        {
            this.allTests();
        }
    }
    exports.Client = Client;
}(typeof global !== "undefined" && typeof global.process !== "undefined" ? module : undefined,
  typeof global !== "undefined" && typeof global.process !== "undefined" ? require :
  (typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope) ? self.Ice._require : window.Ice._require,
  typeof global !== "undefined" && typeof global.process !== "undefined" ? exports :
  (typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope) ? self : window));