-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
118 lines (87 loc) · 2.92 KB
/
test.js
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*global describe,it*/
var booleans = require('./index.js');
var assert = require('assert');
describe('conjuction', function () {
it('x=0 and y=0 should return 0', function () {
assert(booleans.conjuction(0, 0)==0);
});
it('x=0 and y=1 should return 0', function () {
assert(booleans.conjuction(0, 1)==0);
});
it('x=1 and y=0 should return 0', function () {
assert(booleans.conjuction(1, 0)==0);
});
it('x=1 and y=1 should return 1', function () {
assert(booleans.conjuction(1, 1)==1);
});
});
describe('disjuction', function () {
it('x=0 and y=0 should return 0', function () {
assert(booleans.disjuction(0, 0)==0);
});
it('x=0 and y=1 should return 1', function () {
assert(booleans.disjuction(0, 1)==1);
});
it('x=1 and y=0 should return 1', function () {
assert(booleans.disjuction(1, 0)==1);
});
it('x=1 and y=1 should return 1', function () {
assert(booleans.disjuction(1, 1)==1);
});
});
describe('alternativeDenial', function () {
it('x=0 and y=0 should return 1', function () {
assert(booleans.alternativeDenial(0, 0)==1);
});
it('x=0 and y=1 should return 1', function () {
assert(booleans.alternativeDenial(0, 1)==1);
});
it('x=1 and y=0 should return 1', function () {
assert(booleans.alternativeDenial(1, 0)==1);
});
it('x=1 and y=1 should return 0', function () {
assert(booleans.alternativeDenial(1, 1)==0);
});
});
describe('jointDenial', function () {
it('x=0 and y=0 should return 1', function () {
assert(booleans.jointDenial(0, 0)==1);
});
it('x=0 and y=1 should return 0', function () {
assert(booleans.jointDenial(0, 1)==0);
});
it('x=1 and y=0 should return 0', function () {
assert(booleans.jointDenial(1, 0)==0);
});
it('x=1 and y=1 should return 0', function () {
assert(booleans.jointDenial(1, 1)==0);
});
});
describe('nonImplicationX', function () {
it('x=0 and y=0 should return 0', function () {
assert(booleans.nonImplicationX(0, 0)==0);
});
it('x=0 and y=1 should return 0', function () {
assert(booleans.nonImplicationX(0, 1)==0);
});
it('x=1 and y=0 should return 1', function () {
assert(booleans.nonImplicationX(1, 0)==1);
});
it('x=1 and y=1 should return 0', function () {
assert(booleans.nonImplicationX(1, 1)==0);
});
});
describe('implicationX', function () {
it('x=0 and y=0 should return 1', function () {
assert(booleans.implicationX(0, 0)==1);
});
it('x=0 and y=1 should return 1', function () {
assert(booleans.implicationX(0, 1)==1);
});
it('x=1 and y=0 should return 0', function () {
assert(booleans.implicationX(1, 0)==0);
});
it('x=1 and y=1 should return 1', function () {
assert(booleans.implicationX(1, 1)==1);
});
});