1 /* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
17 var assert = require('assert');
18 var util = require('util');
21 var timerFired = false;
22 var shouldnotFired = false;
24 setTimeout(function(a, b, c) {
25 assert.equal(arguments.length, 3);
26 assert.equal(arguments[0], 1);
27 assert.equal(arguments[1], 2);
28 assert.equal(arguments[2], 3);
37 setInterval(function(list) {
38 assert.equal(arguments.length, 1);
39 assert(util.isArray(list));
40 assert.equal(list.length, 5);
41 if (i >= list.length) {
44 assert.equal(list[i], i * i);
47 }, 100, [0, 1, 4, 9, 16]);
50 var t = setTimeout(function() {
51 shouldnotFired = true;
56 process.on('exit', function(code) {
57 assert.equal(code, 0);
60 assert.equal(shouldnotFired, false);