commit 8b1570a6b9c155f572b34c9cf707fd4b9641b125
parent 0a371a67cb3bcc3a2787b2bdefdcacd1ba16d822
Author: finwo <finwo@pm.me>
Date: Tue, 27 Nov 2018 16:24:55 +0100
More testing
Diffstat:
4 files changed, 56 insertions(+), 4 deletions(-)
diff --git a/src/operators/and-not.test.js b/src/operators/and-not.test.js
@@ -0,0 +1,27 @@
+import expect from 'expect';
+const andNot = require('./index')['AND NOT'];
+
+const minus = n => () => -n(),
+ zero = () => 0,
+ one = () => 1,
+ two = () => 2,
+ three = () => 3,
+ four = () => 4,
+ five = () => 5;
+
+test('Verifying positive numbers', async () => {
+ expect(andNot(zero , one )()).toBe(0);
+ expect(andNot(one , two )()).toBe(1);
+ expect(andNot(two , three)()).toBe(2);
+ expect(andNot(three, four )()).toBe(3);
+ expect(andNot(four , five )()).toBe(4);
+});
+
+test('Mixing negative numbers', async () => {
+ expect(andNot(minus(two), one )()).toBe(-1);
+ expect(andNot( two , minus(one))()).toBe( 1);
+});
+
+test('Matching abs', async () => {
+ expect(andNot(minus(two), two)()).toBe(-2);
+});
diff --git a/src/operators/and.test.js b/src/operators/and.test.js
@@ -1,5 +1,5 @@
import expect from 'expect';
-import and from './and';
+const and = require('./index')['AND'];
const minus = n => () => -n(),
zero = () => 0,
@@ -22,7 +22,6 @@ test('Mixing negative numbers', async () => {
expect(and( two , minus(one))()).toBe(-1);
});
-
test('Matching abs', async () => {
expect(and(minus(two), two)()).toBe(-2);
});
diff --git a/src/operators/or-not.test.js b/src/operators/or-not.test.js
@@ -0,0 +1,27 @@
+import expect from 'expect';
+const orNot = require('./index')['OR NOT'];
+
+const minus = n => () => -n(),
+ zero = () => 0,
+ one = () => 1,
+ two = () => 2,
+ three = () => 3,
+ four = () => 4,
+ five = () => 5;
+
+test('Verifying positive numbers', async () => {
+ expect(orNot(zero , one )()).toBe(-1);
+ expect(orNot(one , two )()).toBe(-2);
+ expect(orNot(two , three)()).toBe(-3);
+ expect(orNot(three, four )()).toBe(-4);
+ expect(orNot(four , five )()).toBe(-5);
+});
+
+test('Mixing negative numbers', async () => {
+ expect(orNot(minus(two), one )()).toBe(-2);
+ expect(orNot( two , minus(one))()).toBe( 2);
+});
+
+test('Matching abs', async () => {
+ expect(orNot(minus(two), two)()).toBe(-2);
+});
diff --git a/src/operators/or.test.js b/src/operators/or.test.js
@@ -1,5 +1,5 @@
import expect from 'expect';
-import or from './or';
+const or = require('./index')['OR'];
const minus = n => () => -n(),
zero = () => 0,
@@ -22,7 +22,6 @@ test('Mixing negative numbers', async () => {
expect(or( two , minus(one))()).toBe( 2);
});
-
test('Matching abs', async () => {
expect(or(minus(two), two)()).toBe(2);
});