1- import * as R from 'ramda' ;
21import eq from './shared/eq' ;
3- import { nand } from '../src' ;
2+ import * as RA from '../src' ;
43
5- describe ( 'nand' , ( ) => {
6- it ( 'compared two values with nand' , ( ) => {
7- eq ( nand ( true , true ) , false ) ;
8- eq ( nand ( false , true ) , true ) ;
9- eq ( nand ( true , false ) , true ) ;
10- eq ( nand ( false , false ) , true ) ;
11- eq ( nand ( 1.0 , 1.0 ) , false ) ;
12- eq ( nand ( 0.0 , 1.0 ) , true ) ;
13- eq ( nand ( 1.0 , 0.0 ) , true ) ;
14- eq ( nand ( 0.0 , 0.0 ) , true ) ;
4+ describe ( 'RA.nand' , function ( ) {
5+ it ( 'should work on booleans' , function ( ) {
6+ eq ( RA . nand ( true , true ) , false ) ;
7+ eq ( RA . nand ( false , true ) , true ) ;
8+ eq ( RA . nand ( true , false ) , true ) ;
9+ eq ( RA . nand ( false , false ) , true ) ;
1510 } ) ;
16- } ) ;
11+
12+ it ( 'should work on numbers' , function ( ) {
13+ eq ( RA . nand ( 1.0 , 1.0 ) , false ) ;
14+ eq ( RA . nand ( 0.0 , 1.0 ) , true ) ;
15+ eq ( RA . nand ( 1.0 , 0.0 ) , true ) ;
16+ eq ( RA . nand ( 0.0 , 0.0 ) , true ) ;
17+ } ) ;
18+
19+ it ( 'should work on a combination of things' , function ( ) {
20+ eq ( RA . nand ( true , 1.0 ) , false ) ;
21+ eq ( RA . nand ( null , true ) , true ) ;
22+ eq ( RA . nand ( 1.0 , undefined ) , true ) ;
23+ eq ( RA . nand ( 0.0 , false ) , true ) ;
24+ eq ( RA . nand ( null , null ) , true ) ;
25+ eq ( RA . nand ( null , undefined ) , true ) ;
26+ } ) ;
27+
28+ it ( 'should support currying' , function ( ) {
29+ eq ( RA . nand ( true , true ) , false ) ;
30+ eq ( RA . nand ( true ) ( true ) , false ) ;
31+ eq ( RA . nand ( false , true ) , true ) ;
32+ eq ( RA . nand ( false ) ( true ) , true ) ;
33+ eq ( RA . nand ( true , false ) , true ) ;
34+ eq ( RA . nand ( true ) ( false ) , true ) ;
35+ eq ( RA . nand ( false , false ) , true ) ;
36+ eq ( RA . nand ( false ) ( false ) , true ) ;
37+ } ) ;
38+ } ) ;
0 commit comments