Skip to content

Commit fa127f5

Browse files
🐛 fix(Integer.toString): Remove side effects.
Fixes #20.
1 parent 9bb4368 commit fa127f5

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"dependencies": {
3131
"@aureooms/js-error": "^4.0.0",
32-
"@aureooms/js-integer-big-endian": "^5.0.0"
32+
"@aureooms/js-integer-big-endian": "^5.0.1"
3333
},
3434
"devDependencies": {
3535
"@aureooms/js-algorithms": "3.0.7",

test/src/Integer/toString.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,10 @@ test( 'ZZ.from(3).pow(50).bin()' , t => {
1212
test( 'ZZ.from(3).pow(50).oct()' , t => { t.is(ZZ.from(3).pow(50).oct() , '230012517606662772047361711' ) ; } ) ;
1313
test( 'ZZ.from(3).pow(50).hex()' , t => { t.is(ZZ.from(3).pow(50).hex() , '980553f0db2fd09de3c9' ) ; } ) ;
1414

15-
// TODO test side effects of priting in an other base
15+
test( 'toString is pure' , t => {
16+
const x = ZZ.from(10000) ;
17+
t.is('10000', x.toString(10));
18+
t.is('10000', x.toString(10));
19+
t.is('2710', x.toString(16));
20+
t.is('2710', x.toString(16));
21+
})

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
resolved "https://registry.yarnpkg.com/@aureooms/js-error/-/js-error-4.0.0.tgz#cea0a145f5290f443911b3d1890d7254a18eeb9b"
1818
integrity sha512-omwmz82cPxqRnorZ8tqeIcPj1QcJnCsMiVYcwOh/QfUXhJ+DmiBPgWOm5WWAQvQzYVKe0/k7+s2ie+UoRJagjA==
1919

20-
"@aureooms/js-integer-big-endian@^5.0.0":
21-
version "5.0.0"
22-
resolved "https://registry.yarnpkg.com/@aureooms/js-integer-big-endian/-/js-integer-big-endian-5.0.0.tgz#f16380210038e8f40dc1c160c5414981d1695e0e"
23-
integrity sha512-dj5zu9FACN8Z6j0C5gu/0dGJ1idMAiO2zjw9XTK9qpbiiVrKw+cPgTmTAVxyu8B1zVo2TPh0K0do0dko1mjmTA==
20+
"@aureooms/js-integer-big-endian@^5.0.1":
21+
version "5.0.1"
22+
resolved "https://registry.yarnpkg.com/@aureooms/js-integer-big-endian/-/js-integer-big-endian-5.0.1.tgz#a0c63b09f12513d72e1b99fb82f49c7023e5743a"
23+
integrity sha512-iMBF2lWXwIeY2xeDsbpZJlQTD5yyf9OTZswR3fB3sSjNO7hCTrhGD+I0Y7Sz+jNFp68wDKM5FtKcVVGlHCiNhw==
2424

2525
"@aureooms/[email protected]":
2626
version "1.0.2"

0 commit comments

Comments
 (0)