Skip to content

Commit

Permalink
🐛 fix(Integer.toString): Remove side effects.
Browse files Browse the repository at this point in the history
Fixes #20.
  • Loading branch information
make-github-pseudonymous-again committed May 2, 2020
1 parent 9bb4368 commit fa127f5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -29,7 +29,7 @@
},
"dependencies": {
"@aureooms/js-error": "^4.0.0",
"@aureooms/js-integer-big-endian": "^5.0.0"
"@aureooms/js-integer-big-endian": "^5.0.1"
},
"devDependencies": {
"@aureooms/js-algorithms": "3.0.7",
Expand Down
8 changes: 7 additions & 1 deletion test/src/Integer/toString.js
Expand Up @@ -12,4 +12,10 @@ test( 'ZZ.from(3).pow(50).bin()' , t => {
test( 'ZZ.from(3).pow(50).oct()' , t => { t.is(ZZ.from(3).pow(50).oct() , '230012517606662772047361711' ) ; } ) ;
test( 'ZZ.from(3).pow(50).hex()' , t => { t.is(ZZ.from(3).pow(50).hex() , '980553f0db2fd09de3c9' ) ; } ) ;

// TODO test side effects of priting in an other base
test( 'toString is pure' , t => {
const x = ZZ.from(10000) ;
t.is('10000', x.toString(10));
t.is('10000', x.toString(10));
t.is('2710', x.toString(16));
t.is('2710', x.toString(16));
})
8 changes: 4 additions & 4 deletions yarn.lock
Expand Up @@ -17,10 +17,10 @@
resolved "https://registry.yarnpkg.com/@aureooms/js-error/-/js-error-4.0.0.tgz#cea0a145f5290f443911b3d1890d7254a18eeb9b"
integrity sha512-omwmz82cPxqRnorZ8tqeIcPj1QcJnCsMiVYcwOh/QfUXhJ+DmiBPgWOm5WWAQvQzYVKe0/k7+s2ie+UoRJagjA==

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

"@aureooms/js-operator@1.0.2":
version "1.0.2"
Expand Down

0 comments on commit fa127f5

Please sign in to comment.