Skip to content

Commit 985d79c

Browse files
🔍 test: Add test for example code.
1 parent 34db729 commit 985d79c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import test from 'ava' ;
2+
import { parse , stringify , add } from '../../../../src' ;
3+
4+
function macro ( t , A , x , B , y , C , z ) {
5+
const a = parse( A , x ) ;
6+
const b = parse( B , y ) ;
7+
const c = add( a , b ) ;
8+
t.is( stringify( a , x ) , A ) ;
9+
t.is( stringify( b , y ) , B ) ;
10+
t.is( stringify( c , z ) , C ) ;
11+
}
12+
13+
macro.title = ( _ , A , x , B , y , C , z ) => `${A}_${x} + ${B}_${y} = ${C}_${z}` ;
14+
15+
test( macro , 'dead' , 16 , '101010' , 2 , '57047' , 10 ) ;

0 commit comments

Comments
 (0)