Skip to content

Commit a99a028

Browse files
test copy
1 parent 586f2e8 commit a99a028

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test/src/Integer/copy.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import test from 'ava' ;
2+
import { ZZ } from '../../../src' ;
3+
4+
test ( 'Integer#copy' , t => {
5+
6+
const s = '34998403804830' ;
7+
8+
const a = ZZ.from(s) ;
9+
const b = a.copy();
10+
11+
t.is(a.toString(), s);
12+
t.is(b.toString(), s);
13+
14+
a.negate();
15+
16+
t.is(a.toString(), '-'+s);
17+
t.is(b.toString(), s);
18+
19+
a.isub(a);
20+
21+
t.is(a.toString(), '0');
22+
t.is(b.toString(), s);
23+
24+
a.iadd(b);
25+
26+
t.is(a.toString(), s);
27+
t.is(b.toString(), s);
28+
29+
30+
} ) ;

0 commit comments

Comments
 (0)