-
-
Notifications
You must be signed in to change notification settings - Fork 497
Expand file tree
/
Copy pathboolean.js
More file actions
34 lines (23 loc) · 1.09 KB
/
boolean.js
File metadata and controls
34 lines (23 loc) · 1.09 KB
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
'use strict';
const assert = require('assert');
module.exports = require('../common').runTest(test);
function test (binding) {
const bool1 = binding.basic_types_boolean.createBoolean(true);
assert.strictEqual(bool1, true);
const bool2 = binding.basic_types_boolean.createBoolean(false);
assert.strictEqual(bool2, false);
const emptyBoolean = binding.basic_types_boolean.createEmptyBoolean();
assert.strictEqual(emptyBoolean, true);
const bool3 = binding.basic_types_boolean.createBooleanFromExistingValue(true);
assert.strictEqual(bool3, true);
const bool4 = binding.basic_types_boolean.createBooleanFromExistingValue(false);
assert.strictEqual(bool4, false);
const bool5 = binding.basic_types_boolean.createBooleanFromPrimitive(true);
assert.strictEqual(bool5, true);
const bool6 = binding.basic_types_boolean.createBooleanFromPrimitive(false);
assert.strictEqual(bool6, false);
const bool7 = binding.basic_types_boolean.operatorBool(true);
assert.strictEqual(bool7, true);
const bool8 = binding.basic_types_boolean.operatorBool(false);
assert.strictEqual(bool8, false);
}